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

Unified Diff: tests/language/async_return_types_test.dart

Issue 1367433002: Avoid warning when using `return;` from sync* and async* functions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix mock_libraries modification Created 5 years, 3 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 | « tests/compiler/dart2js/type_checker_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/async_return_types_test.dart
diff --git a/tests/language/async_return_types_test.dart b/tests/language/async_return_types_test.dart
index 83eb9a8d992f441ece1e655ef2cece1056798739..1134e25b0038c1d9caf25cac9229d5972427410d 100644
--- a/tests/language/async_return_types_test.dart
+++ b/tests/language/async_return_types_test.dart
@@ -40,6 +40,23 @@ foo7() async {
return new Future<int>.value(3);
}
+
+Iterable<int> foo8() sync* {
+ yield 1;
+ // Can only have valueless return in sync* functions.
+ return
+ 8 /// return_value_sync_star: compile-time error
+ ;
+}
+
+Stream<int> foo9() async* {
+ yield 1;
+ // Can only have valueless return in async* functions.
+ return
+ 8 /// return_value_sync_star: compile-time error
+ ;
+}
+
test() async {
Expect.equals(3, await foo1());
Expect.equals(3, await foo2());
@@ -48,6 +65,8 @@ test() async {
Expect.equals(3, await foo5());
Expect.equals(3, await await foo6());
Expect.equals(3, await await foo7());
+ Expect.listEquals([1], foo8().toList());
+ Expect.listEquals([1], await foo9().toList());
}
main() {
« no previous file with comments | « tests/compiler/dart2js/type_checker_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698