OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /*@testedFeatures=inference*/ | 5 /*@testedFeatures=inference*/ |
6 library test; | 6 library test; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 | 9 |
10 main() async { | 10 main() async { |
11 var /*@type=Future<B>*/ b = new Future<B>.value(new B()); | 11 var /*@type=Future<B>*/ b = new Future<B>.value(new B()); |
12 var /*@type=Future<C>*/ c = new Future<C>.value(new C()); | 12 var /*@type=Future<C>*/ c = new Future<C>.value(new C()); |
13 var /*@type=List<Future<A>>*/ lll = /*@typeArgs=Future<A>*/ [b, c]; | 13 var /*@type=List<Future<A>>*/ lll = /*@typeArgs=Future<A>*/ [b, c]; |
14 var /*@type=List<A>*/ result = | 14 var /*@type=List<A>*/ result = await Future. /*@typeArgs=A*/ wait(lll); |
15 await Future. /*@typeArgs=A*/ /*@target=Future::wait*/ wait(lll); | 15 var /*@type=List<A>*/ result2 = await Future. /*@typeArgs=A*/ wait( |
16 var /*@type=List<A>*/ result2 = | 16 /*@typeArgs=Future<A>*/ [b, c]); |
17 await Future. /*@typeArgs=A*/ /*@target=Future::wait*/ wait( | |
18 /*@typeArgs=Future<A>*/ [b, c]); | |
19 List<A> list = result; | 17 List<A> list = result; |
20 list = result2; | 18 list = result2; |
21 } | 19 } |
22 | 20 |
23 class A {} | 21 class A {} |
24 | 22 |
25 class B extends A {} | 23 class B extends A {} |
26 | 24 |
27 class C extends A {} | 25 class C extends A {} |
OLD | NEW |