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 class C<T> { | 8 class C<T> { |
9 C.optional(void func([T x])) {} | 9 C.optional(void func([T x])) {} |
10 C.named(void func({T x})) {} | 10 C.named(void func({T x})) {} |
11 } | 11 } |
12 | 12 |
13 void optional_toplevel([x = /*@typeArgs=int*/ const [0]]) {} | 13 void optional_toplevel([x = /*@typeArgs=int*/ const [0]]) {} |
14 | 14 |
15 void named_toplevel({x: /*@typeArgs=int*/ const [0]}) {} | 15 void named_toplevel({x: /*@typeArgs=int*/ const [0]}) {} |
16 | 16 |
17 main() { | 17 main() { |
18 void optional_local([x = /*@typeArgs=int*/ const [0]]) {} | 18 void optional_local([/*@type=dynamic*/ x = /*@typeArgs=int*/ const [0]]) {} |
19 void named_local({x: /*@typeArgs=int*/ const [0]}) {} | 19 void named_local({/*@type=dynamic*/ x: /*@typeArgs=int*/ const [0]}) {} |
20 var /*@type=C<dynamic>*/ c_optional_toplevel = | 20 var /*@type=C<dynamic>*/ c_optional_toplevel = |
21 new /*@typeArgs=dynamic*/ C.optional(optional_toplevel); | 21 new /*@typeArgs=dynamic*/ C.optional(optional_toplevel); |
22 var /*@type=C<dynamic>*/ c_named_toplevel = | 22 var /*@type=C<dynamic>*/ c_named_toplevel = |
23 new /*@typeArgs=dynamic*/ C.named(named_toplevel); | 23 new /*@typeArgs=dynamic*/ C.named(named_toplevel); |
24 var /*@type=C<dynamic>*/ c_optional_local = | 24 var /*@type=C<dynamic>*/ c_optional_local = |
25 new /*@typeArgs=dynamic*/ C.optional(optional_local); | 25 new /*@typeArgs=dynamic*/ C.optional(optional_local); |
26 var /*@type=C<dynamic>*/ c_named_local = | 26 var /*@type=C<dynamic>*/ c_named_local = |
27 new /*@typeArgs=dynamic*/ C.named(named_local); | 27 new /*@typeArgs=dynamic*/ C.named(named_local); |
28 var /*@type=C<dynamic>*/ c_optional_closure = | 28 var /*@type=C<dynamic>*/ c_optional_closure = |
29 new /*@typeArgs=dynamic*/ C.optional(/*@returnType=Null*/ ( | 29 new /*@typeArgs=dynamic*/ C.optional(/*@returnType=Null*/ ( |
30 [/*@type=dynamic*/ x = /*@typeArgs=int*/ const [0]]) {}); | 30 [/*@type=dynamic*/ x = /*@typeArgs=int*/ const [0]]) {}); |
31 var /*@type=C<dynamic>*/ c_named_closure = new /*@typeArgs=dynamic*/ C.named( | 31 var /*@type=C<dynamic>*/ c_named_closure = new /*@typeArgs=dynamic*/ C.named( |
32 /*@returnType=Null*/ ( | 32 /*@returnType=Null*/ ( |
33 {/*@type=dynamic*/ x: /*@typeArgs=int*/ const [0]}) {}); | 33 {/*@type=dynamic*/ x: /*@typeArgs=int*/ const [0]}) {}); |
34 } | 34 } |
OLD | NEW |