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

Unified Diff: pkg/analyzer/test/generated/static_type_warning_code_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
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/static_type_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index bf70201e070b6f104bb73ac4fa6343379f517543..c0ea73e317f54df5009d07c2fbc7356eca3c0236 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -54,6 +54,32 @@ f() {}''');
assertErrors(source, [StaticWarningCode.AMBIGUOUS_IMPORT]);
}
+ void test_await_flattened() {
+ Source source = addSource('''
+import 'dart:async';
+Future<Future<int>> ffi() => null;
+f() async {
+ Future<int> b = await ffi(); // Warning: int not assignable to Future<int>
+}
+''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+ verify([source]);
+ }
+
+ void test_await_simple() {
+ Source source = addSource('''
+import 'dart:async';
+Future<int> fi() => null;
+f() async {
+ String a = await fi(); // Warning: int not assignable to String
+}
+''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
+ verify([source]);
+ }
+
void test_expectedOneListTypeArgument() {
Source source = addSource(r'''
main() {
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698