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

Incorrect shadowing problem from rename refactor when new name matches an optional parameter #20358

Closed
stereotype441 opened this issue Aug 4, 2014 · 3 comments
Assignees
Labels
analyzer-refactoring area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@stereotype441
Copy link
Member

Starting from this text:

  void f({foo}) {
  }
  main() {
    var bar;
    f(foo: bar);
  }

Position the cursor on the "bar" in the line "var bar;" and do a rename refactor to rename it to "foo".

This produces the complaint "Usage of parameter 'foo' declared in '...' will be shadowed by renamed local variable."

However, it's not a problem, since the existing usage of "foo" is the name of an optional parameter, and hence won't be shadowed.

@bwilkerson
Copy link
Member

Set owner to @scheglov.
Removed Priority-Unassigned label.
Added Priority-Medium label.

@scheglov
Copy link
Contributor

@scheglov
Copy link
Contributor

@stereotype441 stereotype441 added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-refactoring labels Sep 15, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-refactoring area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

3 participants