-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dart2js TypeImpl overrides operator == #17207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's not clear if this is a bug or not. The VM does not override it, and this leads to incompatibility between VM and dart2js. |
Marked this as being blocked by #21553. |
Issue #23009 has been merged into this issue. cc @karlklose. |
Just ran into this as well. It seems pretty clear to me that this is a bug because it causes programs which are completely valid in the vm to fail in dart2js. |
Apparently, this is somehow fixed with CFE. |
Note - the CFE is missing some compile-time errors. I believe this is not actually fixed, since we still override |
I just filed #32557 reporting why the CFE is not handling this error at this time. The underlying issue in dart2js remains, so I recommend not using Types as const keys or values on switch cases at this time, since it will be an error again soon. |
The language specification currently treats type literals specially: "Every instance of type I read this as permitting TypeImpl to override |
We are very close to be able to mark this issue as fixed. The new RTI is now enabled by default since 2.8.0-dev.1.0. This already makes switch cases work properly because our types are properly canonicalized. One issue remains is that we still override operator== in @rakudrama - @fishythefish and I assume that's safe to remove at this point, correct? |
|
The equality operator is overridden for dart2js' Type implementation TypeIpml.
This means that it cannot be used in switch statements or as keys in constant maps.
See issue #15295 and issue #17123.
The text was updated successfully, but these errors were encountered: