Files
sdk/pkg/front_end/testcases/general/async_function.dart
T
Johnni Winther f40aac1b75 [cfe] Move general testcases into general/ subfolder
Change-Id: I9bc98033babcf887cca2267606cfe9fadd527b5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108605
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-07-11 14:10:17 +00:00

39 lines
797 B
Dart

// 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();
}