// 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. // @dart=2.9 import 'dart:async'; class Class {} dynamic returnDynamic() => new Class(); Class returnClass() => new Class(); Future returnFutureDynamic() async => new Class(); Future returnFutureClass() async => new Class(); Stream> error() async* { yield returnFutureDynamic(); } Stream> stream() async* { yield returnDynamic(); yield returnClass(); yield returnFutureClass(); } main() async { await for (FutureOr cls in stream()) { print(cls); } }