Unexpected behavior when renaming member on a class which inherits from a different package #25666
Labels
analyzer-refactoring
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-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Summary:
Rename/refactor has some unexpected, and potentially unwanted, behavior when working
with identifiers from a different package.
Specifically, in webstorm, if I have a class Foo that declares a member foo and
inherits from class Bar, where Bar is declared in a different package and declares a member bar,
then I can rename foo to bar such that the renamed foo now shadows the bar identifier from Bar.
This is not otherwise allowed if I declare the class Bar in same package as Foo, and could
potentially change the program semantics.
What steps will reproduce the problem?
exports the following class
Change the contents of main.dart to the following:
What is the expected output? What do you see instead?
Expected:
An error should be displayed - Renamed field will shadow getter 'isAwesome'.
Actual:
'isNotAwesome' is renamed to 'isAwesome' and running the program will now yield
the output
where it would previously yield
What version of the product are you using?
Dart SDK-1.15-dev.1.0
This appears to be a change that was introduced in Dart-1.14,
and it has been verified that is does not occur in Dart-1.13.
The text was updated successfully, but these errors were encountered: