EqualityBound
This annotation can only be applied to a value parameter of an equals operator. Annotating any other parameters with it results in a compilation error.
Expresses that equals can only return true if its left-hand side is subtype of bound's argument. In particular,
Body of such
equalsis implicitly modified with preliminary guard checking this subtype relation;On use-sites, compilation error is reported if left-hand side is definitely incompatible with bound's argument.
Please note that this annotation is currently experimental and can only be used with the corresponding '-Xequality-bounds' compiler argument.