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

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

Issue 2892593005: Handle FutureOr type when inferring async closures. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/strong.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cd03355b581a5329284f969fda68387fd027291e..d6258de42710abf3ac131dd6e07f1cf4fd44cb6e 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
@@ -321,8 +321,13 @@ abstract class TypeInferrerImpl extends TypeInferrer {
}
DartType wrapFutureType(DartType type) {
+ var typeWithoutFutureOr = type;
+ if (type is InterfaceType &&
+ identical(type.classNode, coreTypes.futureOrClass)) {
+ typeWithoutFutureOr = type.typeArguments[0];
+ }
return new InterfaceType(coreTypes.futureClass,
- <DartType>[typeSchemaEnvironment.flattenFutures(type)]);
+ <DartType>[typeSchemaEnvironment.flattenFutures(typeWithoutFutureOr)]);
}
DartType wrapType(DartType type, Class class_) {
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698