e202fdb2d5
This in preparation for enabling all bleeding edge experimental features in testcases/general to get early feedback on how new features affect existing code. Change-Id: I060bf0a4d003ecafc489759e3b97a2a4bf4b4aa1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235661 Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
32 lines
733 B
Dart
32 lines
733 B
Dart
// Copyright (c) 2020, 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';
|
|
|
|
class Class {}
|
|
|
|
dynamic returnDynamic() => new Class();
|
|
|
|
Class returnClass() => new Class();
|
|
|
|
Future<dynamic> returnFutureDynamic() async => new Class();
|
|
|
|
Future<Class> returnFutureClass() async => new Class();
|
|
|
|
Stream<FutureOr<Class>> error() async* {
|
|
yield returnFutureDynamic();
|
|
}
|
|
|
|
Stream<FutureOr<Class>> stream() async* {
|
|
yield returnDynamic();
|
|
yield returnClass();
|
|
yield returnFutureClass();
|
|
}
|
|
|
|
main() async {
|
|
await for (FutureOr<Class> cls in stream()) {
|
|
print(cls);
|
|
}
|
|
}
|