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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2895063003: Flatten futures when inferring the type of an async function expression. (Closed)
Patch Set: Don't recurse on future-derived types Created 3 years, 7 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
Index: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 71996f775ba848c391370757a8298b48ba0128ed..cd03355b581a5329284f969fda68387fd027291e 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -320,6 +320,11 @@ abstract class TypeInferrerImpl extends TypeInferrer {
return returnType;
}
+ DartType wrapFutureType(DartType type) {
+ return new InterfaceType(coreTypes.futureClass,
+ <DartType>[typeSchemaEnvironment.flattenFutures(type)]);
+ }
+
DartType wrapType(DartType type, Class class_) {
return new InterfaceType(class_, <DartType>[type]);
}

Powered by Google App Engine
This is Rietveld 408576698