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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2665813002: Fix summary type inference for async closures. (Closed)
Patch Set: Created 3 years, 11 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/task/strong/inferred_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index b12d17dad26cc168b4d98bbc6d3b862c47c7bc0a..0587df1322e7bb2621550c509412fd6c96ea3054 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -4672,6 +4672,9 @@ class TypeInferenceNode extends Node<TypeInferenceNode> {
var linker = functionElement.compilationUnit.library._linker;
var typeProvider = linker.typeProvider;
var typeSystem = linker.typeSystem;
+ if (bodyType.isDartAsyncFutureOr) {
+ bodyType = (bodyType as InterfaceType).typeArguments[0];
+ }
bodyType = typeProvider.futureType
.instantiate([bodyType.flattenFutures(typeSystem)]);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698