Implement primitive equality #51045
Labels
area-meta
Cross-cutting, high-level issues (for tracking many other implementation issues, ...).
implementation
Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
Uh oh!
There was an error while loading. Please reload this page.
Cf. dart-lang/language#2106 for spec updates, https://dart-review.googlesource.com/c/sdk/+/279165 for tests, and dart-lang/language#2108 for background.
This issue is concerned with the implementation of support for primitive equality.
We have previously had the notion of 'a primitive operator
==
', which was improperly ignoringhashCode
, but otherwise capturing the notion that an object has an implementation of equality which is statically known, such that it can be evaluated at compile-time. We required that an object must have a primitive operator==
in a few situations, e.g., in order to be a member of a constant set. With the upgrade to primitive equality, we have the same constraints, except that bothhashCode
and operator==
must be primitive in this sense.The tests show that the analyzer does not report the situation where a member of a constant set has an overriding declaration of
hashCode
(this is a new error, so it's no surprise that we need an update). The CFE would presumably need the same updates, but it only reports a single 'Constant evaluation error' for the constant set/map as a whole, which may or may not be the intended response.Subtasks:
The text was updated successfully, but these errors were encountered: