Skip to content
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

Failures on Remove unnecessary leftover @dart=2.19 from tests. #59625

Open
lrhn opened this issue Nov 27, 2024 · 1 comment
Open

Failures on Remove unnecessary leftover @dart=2.19 from tests. #59625

lrhn opened this issue Nov 27, 2024 · 1 comment
Labels
area-dart2wasm Issues for the dart2wasm compiler. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Nov 27, 2024

There are new test failures on Remove unnecessary leftover @dart=2.19 from tests..

The tests

language/const/map_hashcode_override_legacy_test RuntimeError (expected Pass)

are failing on configurations

dart2wasm-asserts-linux-chrome
dart2wasm-linux-chrome
dart2wasm-linux-d8
dart2wasm-linux-jscm-chrome

In 2.19-mode constant maps/sets should not read the hashCode of objects with trivial equality, they should just use identity hash code (except for the lucky few platform objects where it should use the actual hashCode, likely numbers, Symbol and Type objects, because there will be runtime created objects equal to them).

The Wasm code crashes badly if hashCode throws. (That's a silly thing to do, but we have tests.)
This was probably accepted already, and just popped up again because I copied/renamed a file.

@lrhn lrhn added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-dart2wasm Issues for the dart2wasm compiler. labels Nov 27, 2024
@lrhn
Copy link
Member Author

lrhn commented Nov 27, 2024

(In Dart 3.0, you can't override hashCode and have primitive equality, so a constant hash map won't call a user hashCode, because such an object is not allowed. In Dart <3.0, that was instead achieved by not calling the hashCode. One strategy here is to close our eyes and wait for Dart <3.0 to become unsupported, and blame anyone who makes a throwing hashCode until then - because you shouldn't be doing that anyway.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart2wasm Issues for the dart2wasm compiler. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant