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

Unified Diff: test/codegen/syncstar_syntax.dart

Issue 1207313002: initial sync*, part of #221 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 | « test/codegen/expect/syncstar_yieldstar_test.txt ('k') | test/codegen/syncstar_yield_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/syncstar_syntax.dart
diff --git a/test/codegen/syncstar_syntax.dart b/test/codegen/syncstar_syntax.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e5331dddd13a92fac1ca85627558acc044feea31
--- /dev/null
+++ b/test/codegen/syncstar_syntax.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+Iterable<int> foo() sync* {
+ yield 1;
+ yield* [2, 3];
+}
+
+class Class {
+ Iterable<int> bar() sync* {
+ yield 1;
+ yield* [2, 3];
+ }
+
+ static Iterable<int> baz() sync* {
+ yield 1;
+ yield* [2, 3];
+ }
+}
+
+main() {
+ Iterable<int> qux() sync* {
+ yield 1;
+ yield* [2, 3];
+ }
+
+ foo().forEach(print);
+ new Class().bar().forEach(print);
+ Class.baz().forEach(print);
+ qux().forEach(print);
+}
« no previous file with comments | « test/codegen/expect/syncstar_yieldstar_test.txt ('k') | test/codegen/syncstar_yield_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698