| Index: pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart
|
| diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..38e3d00f47a432406dc538eb8854f896d9b30917
|
| --- /dev/null
|
| +++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart
|
| @@ -0,0 +1,21 @@
|
| +// Copyright (c) 2017, 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.
|
| +
|
| +/*@testedFeatures=inference*/
|
| +library test;
|
| +
|
| +import 'dart:async';
|
| +import 'dart:math' show Random;
|
| +
|
| +main() {
|
| + var /*@type=() → Future<num>*/ f = /*@returnType=Future<num>*/ () async {
|
| + if (new Random().nextBool()) {
|
| + return 1;
|
| + } else {
|
| + return 2.0;
|
| + }
|
| + };
|
| + Future<num> g = /*@promotedType=none*/ f();
|
| + Future<int> h = /*info:ASSIGNMENT_CAST*/ /*@promotedType=none*/ f();
|
| +}
|
|
|