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

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

Issue 2491533002: Don't ovewrite method types of a resynthesized library in TypeResolverVisitor. (Closed)
Patch Set: Created 4 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
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 9941049141386cdbbb4d1b27f14eaed72a4c6838..b589a298377e6aa6733faca0da6910b74cfcff03 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -9761,6 +9761,15 @@ class TypeResolverVisitor extends ScopedVisitor {
AnalysisEngine.instance.logger.logError(buffer.toString(),
new CaughtException(new AnalysisException(), null));
}
+
+ // When the library is resynthesized, types of all of its elements are
+ // already set - statically or inferred. We don't want to overwrite them.
+ // See also dartbug.com/27482 for separating static and inferred types.
Paul Berry 2016/11/09 16:47:22 Do we still need the pointer to bug 27482 now that
+ if (LibraryElementImpl.hasResolutionCapability(
+ definingLibrary, LibraryResolutionCapability.resolvedTypeNames)) {
+ return null;
+ }
+
element.declaredReturnType = _computeReturnType(node.returnType);
element.type = new FunctionTypeImpl(element);
_inferSetterReturnType(element);
@@ -9777,6 +9786,7 @@ class TypeResolverVisitor extends ScopedVisitor {
}
}
}
+
return null;
}

Powered by Google App Engine
This is Rietveld 408576698