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

Unified Diff: testcases/input/async_function.dart

Issue 2473523004: Fix expected return type in async functions (Closed)
Patch Set: Also handle yield* Created 4 years, 1 month 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 | « lib/type_environment.dart ('k') | testcases/spec-mode/async_function.baseline.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testcases/input/async_function.dart
diff --git a/testcases/input/async_function.dart b/testcases/input/async_function.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7b3001e3b2bff060a2f65ef38582fcce7350a180
--- /dev/null
+++ b/testcases/input/async_function.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2016, 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.
+import 'dart:async';
+
+Future<String> asyncString() async {
+ return "foo";
+}
+
+Future<String> asyncString2() async {
+ return asyncString();
+}
+
+Iterable<String> syncStarString() sync* {
+ yield "foo";
+ yield* syncStarString2();
+ yield* stringList;
+}
+
+Iterable<String> syncStarString2() sync* {
+ yield "foo";
+}
+
+Stream<String> asyncStarString() async* {
+ yield "foo";
+ yield* asyncStarString2();
+ yield await asyncString();
+}
+
+Stream<String> asyncStarString2() async* {
+ yield "bar";
+}
+
+List<String> stringList = ["bar"];
+
+main() async {
+ String str = await asyncString();
+}
« no previous file with comments | « lib/type_environment.dart ('k') | testcases/spec-mode/async_function.baseline.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698