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

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

Issue 894063004: Fix return type checking for generator functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.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/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index f63f0890a3f4f8e1217d20f01ef3cb093efaccfd..30b36a42f14793caf64bd01ac3a1e0a65a2277b0 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -1280,6 +1280,27 @@ main() {
verify([source]);
}
+ void test_empty_generator_async() {
+ Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_empty_generator_sync() {
+ Source source = addSource('''
+Iterable<int> f() sync* {
+}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_expectedOneListTypeArgument() {
Source source = addSource(r'''
main() {
@@ -1320,21 +1341,21 @@ export 'lib1.dart';''');
verify([source]);
}
- void test_extraPositionalArguments_function() {
+ void test_extraPositionalArguments_Function() {
Source source = addSource(r'''
-f(p1, p2) {}
-main() {
- f(1, 2);
+f(Function a) {
+ a(1, 2);
}''');
resolve(source);
assertNoErrors(source);
verify([source]);
}
- void test_extraPositionalArguments_Function() {
+ void test_extraPositionalArguments_function() {
Source source = addSource(r'''
-f(Function a) {
- a(1, 2);
+f(p1, p2) {}
+main() {
+ f(1, 2);
}''');
resolve(source);
assertNoErrors(source);
@@ -4030,6 +4051,29 @@ class A {
verify([source]);
}
+ void test_return_in_generator_async() {
+ Source source = addSource('''
+import 'dart:async';
+Stream<int> f() async* {
+ return;
+}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_return_in_generator_sync() {
+ Source source = addSource('''
+Iterable<int> f() sync* {
+ return;
+}
+''');
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_returnInGenerativeConstructor() {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698