Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1702)

Unified Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 1477953002: Fix propagated argument element bug. This fixes #25040. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Alternate fix 2 Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index a715f9a37339d46ad7f0202574b53f211f27b146..8c981ffa59dd0976af2648f4de478319fd789015 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -622,13 +622,17 @@ class ElementResolver extends SimpleAstVisitor<Object> {
bool isConditional = node.operator.type == sc.TokenType.QUESTION_PERIOD;
ClassElementImpl typeReference = getTypeReference(target);
if (typeReference != null) {
- staticElement =
- propagatedElement = _resolveElement(typeReference, methodName);
+ staticElement = _resolveElement(typeReference, methodName);
} else {
staticElement = _resolveInvokedElementWithTarget(
target, staticType, methodName, isConditional);
- propagatedElement = _resolveInvokedElementWithTarget(
- target, propagatedType, methodName, isConditional);
+ // If we have propagated type information use it (since it should
+ // not be redundant with the staticType). Otherwise, don't produce
+ // a propagatedElement which duplicates the staticElement.
+ if (propagatedType is InterfaceType) {
+ propagatedElement = _resolveInvokedElementWithTarget(
+ target, propagatedType, methodName, isConditional);
+ }
}
}
staticElement = _convertSetterToGetter(staticElement);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698