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_) { |