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 typedef T Function2<S, T>(S x); | 8 typedef T Function2<S, T>(S x); |
9 | 9 |
10 void main() { | 10 void main() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Function2<int, List<String>> l4 = /*@returnType=List<String>*/ (int x) { | 50 Function2<int, List<String>> l4 = /*@returnType=List<String>*/ (int x) { |
51 return /*@typeArgs=String*/ [ | 51 return /*@typeArgs=String*/ [ |
52 /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3 | 52 /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3 |
53 ]; | 53 ]; |
54 }; | 54 }; |
55 } | 55 } |
56 { | 56 { |
57 Function2<int, int> | 57 Function2<int, int> |
58 l0 = /*@returnType=int*/ (/*@type=int*/ x) => /*@promotedType=none*/ x; | 58 l0 = /*@returnType=int*/ (/*@type=int*/ x) => /*@promotedType=none*/ x; |
59 Function2<int, int> | 59 Function2<int, int> |
60 l1 = /*@returnType=int*/ (/*@type=int*/ x) => /*@promotedType=none*/ x + | 60 l1 = /*@returnType=int*/ (/*@type=int*/ x) => /*@promotedType=none*/ x /
*@target=num::+*/ + |
61 1; | 61 1; |
62 Function2<int, String> | 62 Function2<int, String> |
63 l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=int*/ (/*@type=int*/ x)
=> | 63 l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=int*/ (/*@type=int*/ x)
=> |
64 /*@promotedType=none*/ x; | 64 /*@promotedType=none*/ x; |
65 Function2<int, String> | 65 Function2<int, String> |
66 l3 = /*@returnType=String*/ (/*@type=int*/ x) => /*info:DYNAMIC_CAST, in
fo:DYNAMIC_INVOKE*/ /*@promotedType=none*/ x | 66 l3 = /*@returnType=String*/ (/*@type=int*/ x) => /*info:DYNAMIC_CAST, in
fo:DYNAMIC_INVOKE*/ /*@promotedType=none*/ x |
67 .substring(3); | 67 .substring(3); |
68 Function2<String, String> | 68 Function2<String, String> |
69 l4 = /*@returnType=String*/ (/*@type=String*/ x) => /*@promotedType=none
*/ x | 69 l4 = /*@returnType=String*/ (/*@type=String*/ x) => /*@promotedType=none
*/ x |
70 .substring(3); | 70 . /*@target=String::substring*/ substring(3); |
71 } | 71 } |
72 } | 72 } |
OLD | NEW |