Skip to content

Missing error for duplicated initializing formal #22057

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
bwilkerson opened this issue Jan 13, 2015 · 2 comments
Closed

Missing error for duplicated initializing formal #22057

bwilkerson opened this issue Jan 13, 2015 · 2 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

@bwilkerson
Copy link
Member

Given the following code:


class C {
  String f;
  C(this.f, {this.f: ''});
}


There should be an error generated because the field 'f' is initialized more than once in the constructor. The VM currently has this behavior and the specification will be updated to clarify that this is the expected behavior.

@bwilkerson bwilkerson added Type-Defect legacy-area-analyzer Use area-devexp instead. labels Jan 13, 2015
@bwilkerson bwilkerson removed the Triaged label Nov 4, 2015
@kevmoo kevmoo 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) and removed Priority-Medium labels Mar 1, 2016
@eernstg
Copy link
Member

eernstg commented Jul 11, 2016

The feature described in #26655 (access to initializing formals) implies that initializing formals will be added to the formal parameter scope for resolution in the initializer list, and that feature has been scheduled for inclusion in the language. The name conflict described in this issue will be in line with the spec after the spec has been updated. So it should be possible to resolve this issue as part of the same process where #26655 is implemented.

@eernstg
Copy link
Member

eernstg commented Nov 30, 2016

I believe this issue is now obsolete (the example does create a name clash which is a compile-time error, and the analyzer does detect it).

Closing. Please reopen if you think there is still an issue.

@eernstg eernstg closed this as completed Nov 30, 2016
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

3 participants