Skip to content

Commit 9eb2e8d

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Stop reporting duplicate diagnostics for other ambiguous extensions
Change-Id: Ia81c43f0ccd41aa09697b6f629fd1d5a3acd3923 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112643 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
1 parent 1f7e637 commit 9eb2e8d

File tree

6 files changed

+182
-158
lines changed

6 files changed

+182
-158
lines changed

pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ class MethodInvocationResolver {
746746
type, _nameCall.name, node.methodName, ElementKind.METHOD);
747747
if (result.isSingle) {
748748
call = result.element;
749+
} else if (result.isAmbiguous) {
750+
return;
749751
}
750752
}
751753
if (call != null && call.kind == ElementKind.METHOD) {

pkg/analyzer/lib/src/dart/resolver/resolution_result.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class ResolutionResult {
2323

2424
/// Initialize a newly created result to represent resolving to a single
2525
/// [element].
26-
const ResolutionResult(this.element) : state = _ResolutionResultState.single;
26+
ResolutionResult(this.element)
27+
: assert(element != null),
28+
state = _ResolutionResultState.single;
2729

2830
/// Initialize a newly created result with no element and the given [state].
2931
const ResolutionResult._(this.state) : element = null;

0 commit comments

Comments
 (0)