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 experimental and can only be used when the corresponding language feature is enabled.