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

Unified Diff: pkg/analyzer/test/generated/resolver_test.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
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 17c8e696a023634a74404b1d2bbc045604acd6da..b2f48d04382a0649beeb4352ad8f4392a2a58870 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -9851,6 +9851,30 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
_listener.assertNoErrors();
}
+ void test_visitAwaitExpression_flattened() {
+ // await e, where e has type Future<Future<int>>
+ InterfaceType intType = _typeProvider.intType;
+ InterfaceType futureIntType =
+ _typeProvider.futureType.substitute4(<DartType>[intType]);
+ InterfaceType futureFutureIntType =
+ _typeProvider.futureType.substitute4(<DartType>[futureIntType]);
+ Expression node =
+ AstFactory.awaitExpression(_resolvedVariable(futureFutureIntType, 'e'));
+ expect(_analyze(node), same(intType));
+ _listener.assertNoErrors();
+ }
+
+ void test_visitAwaitExpression_simple() {
+ // await e, where e has type Future<int>
+ InterfaceType intType = _typeProvider.intType;
+ InterfaceType futureIntType =
+ _typeProvider.futureType.substitute4(<DartType>[intType]);
+ Expression node =
+ AstFactory.awaitExpression(_resolvedVariable(futureIntType, 'e'));
+ expect(_analyze(node), same(intType));
+ _listener.assertNoErrors();
+ }
+
void test_visitBinaryExpression_equals() {
// 2 == 3
Expression node = AstFactory.binaryExpression(

Powered by Google App Engine
This is Rietveld 408576698