| Index: pkg/front_end/testcases/inference/future_union_async_conditional_2.dart
|
| diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8a835fa994f326906aec955f79cb74806412d7c1
|
| --- /dev/null
|
| +++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart
|
| @@ -0,0 +1,31 @@
|
| +// 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';
|
| +
|
| +class MyFuture<T> implements Future<T> {
|
| + MyFuture() {}
|
| + MyFuture.value(x) {}
|
| + dynamic noSuchMethod(invocation);
|
| + MyFuture<S> then<S>(FutureOr<S> f(T x), {Function onError}) => null;
|
| +}
|
| +
|
| +Future<int> g1(bool x) async {
|
| + return /*info:DOWN_CAST_COMPOSITE*/ x
|
| + ? 42
|
| + : /*@typeArgs=int*/ new MyFuture.value(42);
|
| +}
|
| +
|
| +Future<int> g2(bool x) async =>
|
| + /*info:DOWN_CAST_COMPOSITE*/ x
|
| + ? 42
|
| + : /*@typeArgs=int*/ new MyFuture.value(42);
|
| +Future<int> g3(bool x) async {
|
| + var /*@type=Object*/ y =
|
| + x ? 42 : /*@typeArgs=dynamic*/ new MyFuture.value(42);
|
| + return /*info:DOWN_CAST_COMPOSITE*/ /*@promotedType=none*/ y;
|
| +}
|
|
|