// 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; Future getFutureNull() async { return null; } Future getFutureBool() async { return true; } Future test1() async => await getNull(); // ok Future test2() => getNull(); // ok bool test3() => getNull(); // ok Future test4() async => await getFutureNull(); // ok Future test5() => getFutureNull(); // error Future test6() => getFutureBool(); // ok Future test7() async => getFutureBool(); // ok test() async { Future test1() async => await getNull(); // ok Future test2() => getNull(); // ok bool test3() => getNull(); // ok Future test4() async => await getFutureNull(); // ok Future test5() => getFutureNull(); // error Future test6() => getFutureBool(); // ok Future test7() async => getFutureBool(); // ok Future var1 = (() async => await getNull())(); // error Future var2 = (() => getNull())(); // ok bool var3 = (() => getNull())(); // ok Future var4 = (() async => await getFutureNull())(); // error Future var5 = (() => getFutureNull())(); // error Future var6 = (() => getFutureBool())(); // ok Future var7 = (() async => getFutureBool())(); // ok } main() {}