Incorrect shadowing problem from rename refactor when new name matches an optional parameter #20358
Labels
analyzer-refactoring
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
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.
The text was updated successfully, but these errors were encountered: