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

Unified Diff: pkg/analyzer/test/generated/static_warning_code_test.dart

Issue 898513002: Fix async/await type checking in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reformat and sort methods Created 5 years, 11 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/static_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index 0f379adbd0bcc18f041162411faf50e2cd873ac3..df69a541a722c5f50bb4ce9792b8e29687b3860e 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -1407,8 +1407,7 @@ part of lib;
class A {}''', r'''
library lib;
import 'lib1.dart' deferred as p;
-var a = new p.A();'''],
- <ErrorCode>[StaticWarningCode.IMPORT_OF_NON_LIBRARY]);
+var a = new p.A();'''], <ErrorCode>[StaticWarningCode.IMPORT_OF_NON_LIBRARY]);
}
void test_inconsistentMethodInheritanceGetterAndMethod() {
@@ -2945,6 +2944,18 @@ class B {
verify([source]);
}
+ void test_returnWithoutValue_async() {
+ Source source = addSource('''
+import 'dart:async';
+Future<int> f() async {
+ return;
+}
+''');
+ resolve(source);
+ assertErrors(source, [StaticWarningCode.RETURN_WITHOUT_VALUE]);
+ verify([source]);
+ }
+
void test_returnWithoutValue_factoryConstructor() {
Source source = addSource("class A { factory A() { return; } }");
resolve(source);
@@ -3066,8 +3077,7 @@ library root;
import 'lib1.dart' deferred as a;
f(var v) {
v as a.A;
-}'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_catchClause() {
@@ -3080,8 +3090,7 @@ f(var v) {
try {
} on a.A {
}
-}'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_fieldFormalParameter() {
@@ -3093,8 +3102,7 @@ import 'lib1.dart' deferred as a;
class C {
var v;
C(a.A this.v);
-}'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_functionDeclaration_returnType() {
@@ -3126,8 +3134,7 @@ library root;
import 'lib1.dart' deferred as a;
f(var v) {
bool b = v is a.A;
-}'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_methodDeclaration_returnType() {
@@ -3138,8 +3145,7 @@ library root;
import 'lib1.dart' deferred as a;
class C {
a.A m() { return null; }
-}'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+}'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_simpleFormalParameter() {
@@ -3148,8 +3154,7 @@ library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
-f(a.A v) {}'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+f(a.A v) {}'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_typeArgumentList() {
@@ -3159,8 +3164,7 @@ class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
class C<E> {}
-C<a.A> c;'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+C<a.A> c;'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeAnnotationDeferredClass_typeArgumentList2() {
@@ -3192,8 +3196,7 @@ library lib1;
class A {}''', r'''
library root;
import 'lib1.dart' deferred as a;
-a.A v;'''],
- <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+a.A v;'''], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
}
void test_typeParameterReferencedByStatic_field() {

Powered by Google App Engine
This is Rietveld 408576698