cc2a3808ae
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 <scheglov@google.com> Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com> Reviewed-by: Paul Berry <paulberry@google.com>