Skip to content
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

Strong mode should infer parameter types from default value expressions #25794

Closed
stereotype441 opened this issue Feb 17, 2016 · 6 comments
Closed
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@stereotype441
Copy link
Member

Currently, strong mode does not infer the type of the parameter x in the code below:

void f({x: false}) {
  ...
}

It seems like it would be reasonable to do so, since it would be similar to the way it infers the type of variables from their initializer expressions.

@stereotype441 stereotype441 added type-enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Feb 17, 2016
@jmesserly
Copy link

Nice, yeah, we probably just forgot about this AST node.

@munificent munificent mentioned this issue Feb 18, 2016
35 tasks
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed Priority-Medium labels Mar 1, 2016
@jmesserly
Copy link

Doh, I just hit this while implementing/testing #25573 (no-implicit-dynamic). I may roll in a fix or look at it concurrently.

@jmesserly jmesserly self-assigned this Jun 21, 2016
@jmesserly
Copy link

update, fixed it in resolver & element summaries, still haven't got it working in AST-based summaries yet.

@jmesserly
Copy link

https://codereview.chromium.org/2092333002/ -- but I might be way off on that approach :)

@jmesserly
Copy link

Revert CL up, because this regressed cyclic_default_values https://codereview.chromium.org/2109353004/

It seems like this inference will need to be implemented as part of the top-level field inference, if we want to handle top-level/static functions correctly.

@jmesserly jmesserly reopened this Jun 30, 2016
@jmesserly jmesserly reopened this Jun 30, 2016
@jmesserly jmesserly removed their assignment Jul 2, 2016
@jmesserly
Copy link

I'm guessing we do not plan to change the language inference here at this point. closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants