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

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

Issue 904743003: Fix analyzer type checking of "await" expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 50bba0373963087749de1ecae23a09e00d4247fe..06026b3bd6aace1a7818c363a6f66108ea653f25 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -7,6 +7,8 @@ library engine.resolver.error_verifier;
import "dart:math" as math;
import 'dart:collection';
+import 'package:analyzer/src/generated/static_type_analyzer.dart';
+
import 'ast.dart';
import 'constant.dart';
import 'element.dart';
@@ -5885,10 +5887,9 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
}
}
DartType staticReturnType = getStaticType(returnExpression);
- if (staticReturnType != null &&
- _enclosingFunction.isAsynchronous &&
- staticReturnType.element != _typeProvider.futureType.element) {
- return _typeProvider.futureType.substitute4(<DartType>[staticReturnType]);
+ if (staticReturnType != null && _enclosingFunction.isAsynchronous) {
+ return _typeProvider.futureType.substitute4(
+ <DartType>[StaticTypeAnalyzer.flattenFutures(_typeProvider, staticReturnType)]);
}
return staticReturnType;
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698