Skip to content

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

Closed
@JekCharlsonYu

Description

@JekCharlsonYu

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)

Tasks:

Activity

added this to the Dart2.2 milestone on Nov 6, 2018
self-assigned this
on Nov 8, 2018
bwilkerson

bwilkerson commented on Nov 9, 2018

@bwilkerson
Member

@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 (https://dart-review.googlesource.com/37540).

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?

bwilkerson

bwilkerson commented on Nov 12, 2018

@bwilkerson
Member

The rules for equality ('==' and '!=') were updated on 8/23/18 (https://dart-review.googlesource.com/71340), so they are also already in 2.1.

lrhn

lrhn commented on Nov 13, 2018

@lrhn
Member

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.

bwilkerson

bwilkerson commented on Nov 13, 2018

@bwilkerson
Member

Thanks!

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

stereotype441

stereotype441 commented on Nov 29, 2018

@stereotype441
Member

Note that when people start using the new cast and type test operators, they are likely to run into trouble due to #33441, because the analyzer doesn't always assign correct types to constants that are maps or lists. Accordingly, I'm adding a bullet item to fix #33441 before we consider the implementation complete.

MichaelRFairhurst

MichaelRFairhurst commented on Dec 18, 2018

@MichaelRFairhurst
Contributor

#33441 has been closed, the real issue behind it is #35441, which will not affect this issue to nearly the same degree.

I'm still hoping to solve #35441 this week, but its not in my opinion a blocker.

stereotype441

stereotype441 commented on Dec 18, 2018

@stereotype441
Member

We've now completed all the implementation work we know about, but the co19 tests aren't passing, so we're investigating that.

stereotype441

stereotype441 commented on Jan 18, 2019

@stereotype441
Member

Note: there are some new co19 failures (co19_2/LanguageFeatures/Constant_update2018/...) on bot analyzer-linux-release, analyzer-mac-release, and analyzer-win-release as of today.

modified the milestones: Dart2.2, Dart2.2.1 on Feb 26, 2019
stereotype441

stereotype441 commented on Mar 19, 2019

@stereotype441
Member

I'm placing this in the Dart2.3 milestone because @kmillikin and I believe some work may be necessary in order to make the analyzer and the front end behave consistently in Dart 2.3. I'll be meeting with him tomorrow to clarify the details and I'll update this bug after I do so.

stereotype441

stereotype441 commented on Mar 20, 2019

@stereotype441
Member

Ok, I've just finished meeting with @kmillikin. The FE is planning to ship the full functionality of this feature in Dart 2.3, so the analyzer team will plan to do so as well.

added
P2A bug or feature request we're likely to work on
on Mar 22, 2019
dgrove

dgrove commented on Apr 2, 2019

@dgrove
Contributor

Is there more remaining here for 2.3? ( #36296 is no longer in the milestone, but is in the meta-issue list above)

bwilkerson

bwilkerson commented on Apr 2, 2019

@bwilkerson
Member

Not all of the SDK constraint checks have been implemented, but I'm not sure that the remaining ones are worth worrying about. I don't know how @stereotype441 feels about it, but I'd be fine with closing this.

stereotype441

stereotype441 commented on May 30, 2019

@stereotype441
Member

Closing since the only remaining work is covered under #36296

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

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @stereotype441@MichaelRFairhurst@dgrove@lrhn@bwilkerson

      Issue actions

        [Constants-Phase1] Analyzer Issue for Constants Implementation · Issue #35080 · dart-lang/sdk