Commit cc2a380
Refactor DuplicateDefinitionVerifier.
I split _checkDuplicateIdentifier() into two methods. One works with
AST nodes and tokens and the other continues to use fragments. The
former does a better job of reporting the error using the underlying
token location, which will do the correct thing for private named
parameters in a later change.
I kept the old method that works with fragments because I wasn't sure
how to migrate the code for top-level collisions to use AST nodes while
handling declarations from part files.
I did go ahead and simplify that method to only take a single scope and
then pass in the getter or setter scope as appropriate. That seemed
cleaner to me than passing in both and then doing a type test on every
object to see if it's a setter or not: the caller already knows that.
Change-Id: I532e4c7e40ad5ed075ba2044231bf2bac694e8e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463821
Reviewed-by: Konstantin Shcheglov <[email protected]>
Auto-Submit: Bob Nystrom <[email protected]>
Commit-Queue: Bob Nystrom <[email protected]>
Reviewed-by: Paul Berry <[email protected]>1 parent ea9d3cc commit cc2a380
File tree
1 file changed
+150
-131
lines changed- pkg/analyzer/lib/src/error
1 file changed
+150
-131
lines changed
0 commit comments