Skip to content

Implement changes to strong mode top level inference #28219

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

Closed
leafpetersen opened this issue Dec 30, 2016 · 25 comments
Closed

Implement changes to strong mode top level inference #28219

leafpetersen opened this issue Dec 30, 2016 · 25 comments
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@leafpetersen
Copy link
Member

We have an informal spec for top level inference for strong mode here: #28218 . The proposal is ready for feedback from implementers and other team members, and subsequent implementation in the analyzer. This is the tracking bug for the analyzer implementation.

@leafpetersen leafpetersen added this to the 1.22 milestone Dec 30, 2016
@bwilkerson bwilkerson added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 2, 2017
@jmesserly
Copy link

yay!!! 🎉

@kevmoo
Copy link
Member

kevmoo commented Jan 13, 2017

@leafpetersen critical for 1.22? Trying to prioritize...

@leafpetersen
Copy link
Member Author

Lower priority than things that affect non-strong mode (especially syntax).

@stereotype441 stereotype441 self-assigned this Jan 17, 2017
@mit-mit mit-mit added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jan 19, 2017
@mit-mit
Copy link
Member

mit-mit commented Jan 19, 2017

Punting to 1.23 after priority discussion

@mit-mit mit-mit modified the milestones: 1.23, 1.22 Jan 19, 2017
@mit-mit mit-mit removed the P1 A high priority bug; for example, a single project is unusable or has many test failures label Jan 19, 2017
@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label Jan 23, 2017
@vsmenon vsmenon assigned scheglov and unassigned leafpetersen Mar 9, 2017
@dgrove
Copy link
Contributor

dgrove commented Mar 15, 2017

Any updates on this?

@scheglov
Copy link
Contributor

It's not done yet.

I'm working toward new inference - we now can test types directly / without comparing with AnalysisContext results (which are not available), added the sets of tests for inference for initializer and instance methods according to the new rules.

But this is again hinges on being able to use inferencer from linker, so the last biggest client - DDC should be migrated to using the new analysis driver first.

@dgrove
Copy link
Contributor

dgrove commented Mar 20, 2017

@scheglov Is there any issue tracking moving DDC to the analysis driver? That is starting to sound scary for 1.23.

@scheglov
Copy link
Contributor

I've just opened for tracking purposes.
#29118

@scheglov
Copy link
Contributor

We started reporting required errors with this CL.

@kevmoo
Copy link
Member

kevmoo commented Mar 28, 2017

@scheglov so is this resolved then?

@scheglov
Copy link
Contributor

No, it is implemented only partially.
Summary based linker still attempt to perform inference for cases when it is not allowed by the new rules.

@bwilkerson
Copy link
Member

@leafpetersen I believe that we now have enough of this work done that we can ship 1.23, so I'm bumping this issue to 1.24 for the remainder of the work. Please change it back if you disagree.

@bwilkerson bwilkerson modified the milestones: 1.24, 1.23 Apr 3, 2017
@dgrove
Copy link
Contributor

dgrove commented May 1, 2017

How's this looking for 1.24?

@dgrove
Copy link
Contributor

dgrove commented May 12, 2017

Any updates here?

@scheglov scheglov removed their assignment May 13, 2017
@scheglov
Copy link
Contributor

I thought it was done even for 1.23, but we decided do postpone it.
@bwilkerson

@dgrove
Copy link
Contributor

dgrove commented May 23, 2017

What's the plan here? Really happening for 1.24? @bwilkerson

@leafpetersen leafpetersen modified the milestones: 1.25, 1.24 May 24, 2017
@leafpetersen
Copy link
Member Author

This is, as far as I know fully implemented, but we have not rolled out the full restriction yet (currently it is only marked as a hint). Moving this to 1.25. @scheglov has a CL that relaxes the restriction slightly based on feedback. As early as possible in the 1.25 cycle, we will start working on cleaning up internal code to conform to this restriction, and then flip the hints to errors.

cc @srawlins @keertip

@keertip
Copy link
Contributor

keertip commented May 24, 2017

@leafpetersen , we have entered cherry pick season for 1.24, and master is looking good now. So can you go ahead a create a branch now with @scheglov 's cl?

@leafpetersen
Copy link
Member Author

@matanlurey
Copy link
Contributor

@leafpetersen Is there an update here?

I noticed that as of 2.0.0-dev+5, the following resolve to dynamic still:

var x = 'Hello'.codeUnits;
class X {
  var x = 'Hello'.codeUnits;
}

@leafpetersen
Copy link
Member Author

leafpetersen commented Oct 30, 2017

Based on strong user feedback (including yours @matanlurey :) ), we are not implementing these restrictions, but are instead implementing a more general top level inference system. This more powerful system will not be implemented in the existing front end however - it will only be available in the upcoming new front end. Until the new front end comes online, top level inference will not fully match the eventual intended behavior, and will remain in a somewhat less than ideal state. In particular, is is possible that there may be inconsistencies in the inference depending on what mode of analysis is being done (e.g. IDE vs build mode). I landed a CL a while ago to try to resolve the worst of these, but I wouldn't be surprised if there are still lurking issues.

Specifically to your examples, the first one should be resolved to List<int>, and I see it resolved as such in recent bleeding edge when used in the same file. If you are seeing it resolved as dynamic, then feel free to file a bug with a repro, but note that it's unlikely this will be fixed until the new front end comes out.

The second example will be inferred correctly with the new front end, but is not supported by the old front end.

@matanlurey
Copy link
Contributor

Sounds good thanks!

@anders-sandholm
Copy link
Contributor

What is the status of this one?
Can we close it now?

@stereotype441
Copy link
Member

@anders-sandholm The new front end implements inference mostly according to the new spec. (There is a long tail of small bugs but I don't think it's necessary to leave this bug open while they are addressed). So if you want this bug to be about the new front end, we can close it.

If you want this bug to be about the analyzer implementation, we should leave it open, since the analyzer implementation won't follow the new spec until analyzer is switched over to use the new front end.

@leafpetersen
Copy link
Member Author

I'm not sure if this bug is serving any purpose anymore since as I understand it most of this is not planned to be implemented. Should it be closed?

@dgrove dgrove removed this from the 1.25 milestone Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests