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

Unary minus as literal instead of instance call #35316

dcharkes opened this Issue Dec 4, 2018 · 2 comments


None yet
2 participants

dcharkes commented Dec 4, 2018

Code with many unary minuses takes very long to compile #35297.

And these unary minuses as instance calls also creates problems with encoding offsets in ICData #35242.

The frontend should regards these minuses as part of the integer literal, rather than a unary operation.


This comment has been minimized.


lrhn commented Dec 4, 2018

The back-ends should be able to recognize the pattern unary minus on integer literal and make it a compile-time constant themselves, it's basic constant folding. That should at least avoid the calls, without needing to change the input representation (which reflects the source code, so removing it would be throwing away information).


This comment has been minimized.


dcharkes commented Dec 4, 2018

dart-bot pushed a commit that referenced this issue Dec 4, 2018

[gardening] Mark LibTest/collection/ListMixin/ListMixin_class_A01_t02…
… as ExtraSlow

Issue #35316

Change-Id: Iac3c038f9f447e52dd420ad1158cdf153aa99f3e
Reviewed-by: Daco Harkes <>
Reviewed-by: Martin Kustermann <>
Auto-Submit: Daco Harkes <>
Commit-Queue: Daco Harkes <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment