-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Constant folding and runtime behavior have to agree. #2887
Comments
It is not just bit operations. hide(x) => [x][0]; Prints: All three should be the same. In code that evaluates, all constant folding should be done using both dart-full and execution (js) semantics. It is a more difficult decision when the context demands a constant expression, but I think there too the 'correct' value is the incorrect value - e.g. changing 'const' to 'new' at a constructor call should not change the values passed to the constructor. |
FWIW self-hosted frog was a little better with regards to consistency because the self-hosted constant folding was done using JavaScript arithmetic. I think running tests on a self-hosted test of dart2js might help flush out constant folding issues. |
Issue #3358 has been merged into this issue. |
Partial duplicate: issue #4551. |
https://chromiumcodereview.appspot.com/10825386/ Added Started label. |
Added this to the M1 milestone. |
Fixed in r11883. Added Fixed label. |
Currently the behavior for bit-operations differs for constant folded and runtime bit operations.
Example:
~1 != ~one(); // where one() return 1.
The text was updated successfully, but these errors were encountered: