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 void main() { | 8 void main() { |
9 { | 9 { |
10 String f<S>(int x) => null; | 10 String f<S>(int x) => null; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3 | 50 /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3 |
51 ]; | 51 ]; |
52 }; | 52 }; |
53 } | 53 } |
54 { | 54 { |
55 int int2int<S>(int x) => null; | 55 int int2int<S>(int x) => null; |
56 String int2String<T>(int x) => null; | 56 String int2String<T>(int x) => null; |
57 String string2String<T>(String x) => null; | 57 String string2String<T>(String x) => null; |
58 var /*@type=int2int(int) -> int*/ x = int2int; | 58 var /*@type=int2int(int) -> int*/ x = int2int; |
59 x = /*@returnType=int*/ <T>(/*@type=int*/ x) => /*@promotedType=none*/ x; | 59 x = /*@returnType=int*/ <T>(/*@type=int*/ x) => /*@promotedType=none*/ x; |
60 x = /*@returnType=int*/ <T>(/*@type=int*/ x) => /*@promotedType=none*/ x + | 60 x = /*@returnType=int*/ < |
61 1; | 61 T>(/*@type=int*/ x) => /*@promotedType=none*/ x /*@target=num::+*/ + 1; |
62 var /*@type=int2String(int) -> String*/ y = int2String; | 62 var /*@type=int2String(int) -> String*/ y = int2String; |
63 y = /*info:INFERRED_TYPE_CLOSURE, error:INVALID_ASSIGNMENT*/ /*@returnType=i
nt*/ < | 63 y = /*info:INFERRED_TYPE_CLOSURE, error:INVALID_ASSIGNMENT*/ /*@returnType=i
nt*/ < |
64 T>(/*@type=int*/ x) => | 64 T>(/*@type=int*/ x) => |
65 /*@promotedType=none*/ x; | 65 /*@promotedType=none*/ x; |
66 y = /*@returnType=String*/ < | 66 y = /*@returnType=String*/ < |
67 T>(/*@type=int*/ x) => /*info:DYNAMIC_INVOKE, info:DYNAMIC_CAST*/ /*@pro
motedType=none*/ x.substring(3); | 67 T>(/*@type=int*/ x) => /*info:DYNAMIC_INVOKE, info:DYNAMIC_CAST*/ /*@pro
motedType=none*/ x.substring(3); |
68 var /*@type=string2String(String) -> String*/ z = string2String; | 68 var /*@type=string2String(String) -> String*/ z = string2String; |
69 z = /*@returnType=String*/ < | 69 z = /*@returnType=String*/ <T>(/*@type=String*/ x) => /*@promotedType=none*/
x |
70 T>(/*@type=String*/ x) => /*@promotedType=none*/ x.substring(3); | 70 . /*@target=String::substring*/ substring(3); |
71 } | 71 } |
72 } | 72 } |
OLD | NEW |