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

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

Issue 2161163003: Fix closure parameter types propagation after limited invalidation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months 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/src/context/context_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/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index debb318e03aa2331741a464c2b277bd6d4c05678..d9d0b0d96d7516c8038bd2f9636f4bd63904f391 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -10164,6 +10164,20 @@ class TypeResolverVisitor extends ScopedVisitor {
}
@override
+ Object visitFunctionExpression(FunctionExpression node) {
+ // Clear the static element return type of closures.
+ // We need this to restore the state when closure parameter types can
+ // be propagated from invocation parameter types.
+ if (node is! FunctionDeclaration) {
+ ExecutableElement element = node.element;
+ if (element is FunctionElementImpl) {
+ element.returnType = null;
+ }
+ }
+ return super.visitFunctionExpression(node);
+ }
+
+ @override
Object visitFunctionTypeAlias(FunctionTypeAlias node) {
FunctionTypeAliasElementImpl element =
node.element as FunctionTypeAliasElementImpl;
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698