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

[Constants-Phase1] Analyzer Issue for Constants Implementation #35080

JekCharlsonYu opened this Issue Nov 6, 2018 · 4 comments


None yet
4 participants

JekCharlsonYu commented Nov 6, 2018

Request: As per implementation plan,

***Analyzer and CFE
**The analyzer and CFE implements support for the new constant and potentially constant expressions behind the experimental flag.

Phase 1 ETA: please see issue [tracker] (dart-lang/language#60)


  • Cast Operator
  • Type Test Operator
  • Equality Operator
  • The operator >>>
  • The operator &
  • The operator |
  • The operator ^
  • Short-Circuit &&
  • Short-Circuit ||
  • Short-Circuit ??
  • Short-Circuit ?:

@JekCharlsonYu JekCharlsonYu added this to the Dart2.2 milestone Nov 6, 2018

@mit-mit mit-mit referenced this issue Nov 6, 2018


Implementation issue for constant changes Q4'18 #60

0 of 17 tasks complete

@bwilkerson bwilkerson self-assigned this Nov 8, 2018


This comment has been minimized.


bwilkerson commented Nov 9, 2018

@lrhn @mit-mit

I started looking at what it would take to implement this experiment, and I found that some of the work is already done. For example, the && and || operators have been lazy in the analyzer since 1/30/18 (

We could potentially put the current implementation behind the flag and then revert the change to make them eagerly evaluate their arguments, but I'm concerned that that would break existing users.

Are we certain that all of these changes are really different than the 2.1 behavior?

How would you like me to handle this situation?


This comment has been minimized.


bwilkerson commented Nov 12, 2018

The rules for equality ('==' and '!=') were updated on 8/23/18 (, so they are also already in 2.1.


This comment has been minimized.


lrhn commented Nov 13, 2018

It seems that == and != works everywhere (analyzer, dart2js, VM),
but && and || only works in the analyzer and VM, they fail in dart2js.
In the VM, anything goes, really, even things that were never valid. It's probably a case of CFE missing errors, where dart2js has its own constant system catching the error, and running the old rules.

It does mean that there might be code out there using these features, passing the analyzer and running on the VM, so we can't retract the already working functionality.
So, ==, !=, && and || functionality should keep working without the experimental flag in the analyzer and VM (CFE). Dart2js is free to keep it not working without the experimental flag, or just follow the CFE.


This comment has been minimized.


bwilkerson commented Nov 13, 2018


@sigmundch (For the dart2js reference in the previous comment.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment