// 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. dynamic getNull() => null; Stream getStreamNull() async* { yield null; } Stream getStreamBool() async* { yield true; } Stream test1() async* { yield getNull(); // ok } Stream test2() => getNull(); // ok bool test3() => getNull(); // ok Stream test4() async* { yield* getStreamNull(); // error } Stream test5() => getStreamNull(); // error Stream test6() => getStreamBool(); // ok Stream test7() async* { yield* getStreamBool(); // ok } test() async { Stream test1() async* { yield getNull(); // ok } Stream test2() => getNull(); // ok bool test3() => getNull(); // ok Stream test4() async* { yield* getStreamNull(); // error } Stream test5() => getStreamNull(); // error Stream test6() => getStreamBool(); // ok Stream test7() async* { yield* getStreamBool(); // ok } Stream var1 = (() async* { yield getNull(); })(); // error Stream var2 = (() => getNull())(); // ok bool var3 = (() => getNull())(); // ok Stream var4 = (() async* { yield* getStreamNull(); })(); // error Stream var5 = (() => getStreamNull())(); // error Stream var6 = (() => getStreamBool())(); // ok Stream var7 = (() async* { yield* getStreamBool(); })(); // ok } main() {}