OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 // GENERATED - DON'T EDIT. | 5 // GENERATED - DON'T EDIT. |
6 // GENERATED - DON'T EDIT. | 6 // GENERATED - DON'T EDIT. |
7 // GENERATED - DON'T EDIT. | 7 // GENERATED - DON'T EDIT. |
8 // GENERATED - DON'T EDIT. | 8 // GENERATED - DON'T EDIT. |
9 // GENERATED - DON'T EDIT. | 9 // GENERATED - DON'T EDIT. |
10 // GENERATED - DON'T EDIT. | 10 // GENERATED - DON'T EDIT. |
11 // GENERATED - DON'T EDIT. | 11 // GENERATED - DON'T EDIT. |
12 // GENERATED - DON'T EDIT. | 12 // GENERATED - DON'T EDIT. |
13 | 13 |
14 import 'dart:core'; | 14 import 'dart:core'; |
15 import 'dart:core' as core; | 15 import 'dart:core' as core; |
16 import 'package:expect/expect.dart'; | 16 import 'package:expect/expect.dart'; |
17 | 17 |
18 @NoInline() | 18 @NoInline() |
19 @AssumeDynamic() | 19 @AssumeDynamic() |
20 confuse(f) => f; | 20 confuse(f) => f; |
21 | 21 |
22 final bool inCheckedMode = | 22 final bool inCheckedMode = (() { |
23 (() { bool result = false; assert(result = true); return result; })(); | 23 bool result = false; |
| 24 assert(result = true); |
| 25 return result; |
| 26 })(); |
24 | 27 |
25 | 28 typedef F0<T> |
26 typedef F0<T> = int Function(int x0, {List<T> x}); | 29 = int Function(int x0, {List<T> x}); |
27 typedef F1<T> = List<Function> Function({core.List<core.int> x}); | 30 typedef F1<T> |
28 typedef F2<T> = List<T> Function(int x, [List<Function> x2]); | 31 = List<Function> Function({core.List<core.int> x}); |
29 typedef F3<T> = void Function(int x1, [Function x2]); | 32 typedef F2<T> |
30 typedef F4<T> = List<A> Function<A>(); | 33 = List<T> Function(int x, [List<Function> x2]); |
31 typedef F5<T> = int Function(List<Function> x) Function(int x); | 34 typedef F3<T> |
32 typedef F6<T> = int Function(int y, [List<T> x]) Function(int x); | 35 = void Function(int x1, [Function x2]); |
33 typedef F7<T> = Function Function([Function x1]) Function(int x); | 36 typedef F4<T> |
34 typedef F8<T> = Function Function({core.List<core.int> x}) Function(int x); | 37 = List<A> Function<A>(); |
35 typedef F9<T> = List<Function> Function(int y, {int x}) Function(int x); | 38 typedef F5<T> |
36 typedef F10<T> = List<Function> Function(int x1, [core.List<core.int> x]) Functi
on(int x); | 39 = int Function(List<Function> x) Function(int x); |
37 typedef F11<T> = core.List<core.int> Function(int x1) Function(int x); | 40 typedef F6<T> |
38 typedef F12<T> = core.List<core.int> Function(int x, [List<Function> x1]) Functi
on(int x); | 41 = int Function(int y, [List<T> x]) Function(int x); |
39 typedef F13<T> = core.List<core.int> Function(int y, {List<T> x}) Function(int x
); | 42 typedef F7<T> |
40 typedef F14<T> = List<T> Function([List<Function> x]) Function(int x); | 43 = Function Function([Function x1]) Function(int x); |
41 typedef F15<T> = List<T> Function(List<T> x1) Function(int x); | 44 typedef F8<T> |
42 typedef F16<T> = Function(int x2, [Function x3]) Function(int x); | 45 = Function Function({core.List<core.int> x}) Function(int x); |
43 typedef F17<T> = Function(int x1, {core.List<core.int> x}) Function(int x); | 46 typedef F9<T> |
44 typedef F18<T> = void Function(Function x) Function(int x); | 47 = List<Function> Function(int y, {int x}) Function(int x); |
45 typedef F19<T> = void Function(int y, [core.List<core.int> x]) Function(int x); | 48 typedef F10<T> |
46 typedef F20<T> = int Function<A>() Function(int x); | 49 = List<Function> Function(int x1, [core.List<core.int> x]) Function(int x); |
47 typedef F21<T> = core.List<core.int> Function<A>(A x) Function(int x); | 50 typedef F11<T> |
48 typedef F22<T> = A Function<A>(List<A> x) Function(int x); | 51 = core.List<core.int> Function(int x1) Function(int x); |
49 | 52 typedef F12<T> |
| 53 = core.List<core.int> Function(int x, [List<Function> x1]) Function(int x); |
| 54 typedef F13<T> |
| 55 = core.List<core.int> Function(int y, {List<T> x}) Function(int x); |
| 56 typedef F14<T> |
| 57 = List<T> Function([List<Function> x]) Function(int x); |
| 58 typedef F15<T> |
| 59 = List<T> Function(List<T> x1) Function(int x); |
| 60 typedef F16<T> |
| 61 = Function(int x2, [Function x3]) Function(int x); |
| 62 typedef F17<T> |
| 63 = Function(int x1, {core.List<core.int> x}) Function(int x); |
| 64 typedef F18<T> |
| 65 = void Function(Function x) Function(int x); |
| 66 typedef F19<T> |
| 67 = void Function(int y, [core.List<core.int> x]) Function(int x); |
| 68 typedef F20<T> |
| 69 = int Function<A>() Function(int x); |
| 70 typedef F21<T> |
| 71 = core.List<core.int> Function<A>(A x) Function(int x); |
| 72 typedef F22<T> |
| 73 = A Function<A>(List<A> x) Function(int x); |
50 | 74 |
51 int f0(int x0, {List<int> x}) => null; | 75 int f0(int x0, {List<int> x}) => null; |
52 List<Function> f1({core.List<core.int> x}) => null; | 76 List<Function> f1({core.List<core.int> x}) => null; |
53 List<int> f2(int x, [List<Function> x0]) => null; | 77 List<int> f2(int x, [List<Function> x0]) => null; |
54 void f3(int x0, [Function x1]) => null; | 78 void f3(int x0, [Function x1]) => null; |
55 List<A> f4<A>() => null; | 79 List<A> f4<A>() => null; |
56 int Function(List<Function> x) f5(int x) => null; | 80 int Function(List<Function> x) f5(int x) => null; |
57 int Function(int y, [List<int> x]) f6(int x) => null; | 81 int Function(int y, [List<int> x]) f6(int x) => null; |
58 Function Function([Function x0]) f7(int x) => null; | 82 Function Function([Function x0]) f7(int x) => null; |
59 Function Function({core.List<core.int> x}) f8(int x) => null; | 83 Function Function({core.List<core.int> x}) f8(int x) => null; |
60 List<Function> Function(int y, {int x}) f9(int x) => null; | 84 List<Function> Function(int y, {int x}) f9(int x) => null; |
61 List<Function> Function(int x0, [core.List<core.int> x]) f10(int x) => null; | 85 List<Function> Function(int x0, [core.List<core.int> x]) f10(int x) => null; |
62 core.List<core.int> Function(int x0) f11(int x) => null; | 86 core.List<core.int> Function(int x0) f11(int x) => null; |
63 core.List<core.int> Function(int x, [List<Function> x0]) f12(int x) => null; | 87 core.List<core.int> Function(int x, [List<Function> x0]) f12(int x) => null; |
64 core.List<core.int> Function(int y, {List<int> x}) f13(int x) => null; | 88 core.List<core.int> Function(int y, {List<int> x}) f13(int x) => null; |
65 List<int> Function([List<Function> x]) f14(int x) => null; | 89 List<int> Function([List<Function> x]) f14(int x) => null; |
66 List<int> Function(List<int> x0) f15(int x) => null; | 90 List<int> Function(List<int> x0) f15(int x) => null; |
67 Function(int x0, [Function x1]) f16(int x) => null; | 91 Function(int x0, [Function x1]) f16(int x) => null; |
68 Function(int x0, {core.List<core.int> x}) f17(int x) => null; | 92 Function(int x0, {core.List<core.int> x}) f17(int x) => null; |
69 void Function(Function x) f18(int x) => null; | 93 void Function(Function x) f18(int x) => null; |
70 void Function(int y, [core.List<core.int> x]) f19(int x) => null; | 94 void Function(int y, [core.List<core.int> x]) f19(int x) => null; |
71 int Function<A>() f20(int x) => null; | 95 int Function<A>() f20(int x) => null; |
72 core.List<core.int> Function<A>(A x) f21(int x) => null; | 96 core.List<core.int> Function<A>(A x) f21(int x) => null; |
73 A Function<A>(List<A> x) f22(int x) => null; | 97 A Function<A>(List<A> x) f22(int x) => null; |
74 | 98 |
75 | |
76 class U53<T> { | 99 class U53<T> { |
77 final bool tIsBool; | 100 final bool tIsBool; |
78 final bool tIsInt; | 101 final bool tIsInt; |
79 final bool tIsDynamic; | 102 final bool tIsDynamic; |
80 | 103 |
81 int Function(int x0, {List<T> x}) x0; | 104 int Function(int x0, {List<T> x}) x0; |
82 List<Function> Function({core.List<core.int> x}) x1; | 105 List<Function> Function({core.List<core.int> x}) x1; |
83 List<T> Function(int x, [List<Function> x2]) x2; | 106 List<T> Function(int x, [List<Function> x2]) x2; |
84 void Function(int x1, [Function x2]) x3; | 107 void Function(int x1, [Function x2]) x3; |
85 List<A> Function<A>() x4; | 108 List<A> Function<A>() x4; |
86 int Function(List<Function> x) Function(int x) x5; | 109 int Function(List<Function> x) Function(int x) x5; |
87 int Function(int y, [List<T> x]) Function(int x) x6; | 110 int Function(int y, [List<T> x]) Function(int x) x6; |
88 Function Function([Function x1]) Function(int x) x7; | 111 Function Function([Function x1]) Function(int x) x7; |
89 Function Function({core.List<core.int> x}) Function(int x) x8; | 112 Function Function({core.List<core.int> x}) Function(int x) x8; |
90 List<Function> Function(int y, {int x}) Function(int x) x9; | 113 List<Function> Function(int y, {int x}) Function(int x) x9; |
91 List<Function> Function(int x1, [core.List<core.int> x]) Function(int x) x10; | 114 List<Function> Function(int x1, [core.List<core.int> x]) Function(int x) x10; |
92 core.List<core.int> Function(int x1) Function(int x) x11; | 115 core.List<core.int> Function(int x1) Function(int x) x11; |
93 core.List<core.int> Function(int x, [List<Function> x1]) Function(int x) x12; | 116 core.List<core.int> Function(int x, [List<Function> x1]) Function(int x) x12; |
94 core.List<core.int> Function(int y, {List<T> x}) Function(int x) x13; | 117 core.List<core.int> Function(int y, {List<T> x}) Function(int x) x13; |
95 List<T> Function([List<Function> x]) Function(int x) x14; | 118 List<T> Function([List<Function> x]) Function(int x) x14; |
96 List<T> Function(List<T> x1) Function(int x) x15; | 119 List<T> Function(List<T> x1) Function(int x) x15; |
97 Function(int x2, [Function x3]) Function(int x) x16; | 120 Function(int x2, [Function x3]) Function(int x) x16; |
98 Function(int x1, {core.List<core.int> x}) Function(int x) x17; | 121 Function(int x1, {core.List<core.int> x}) Function(int x) x17; |
99 void Function(Function x) Function(int x) x18; | 122 void Function(Function x) Function(int x) x18; |
100 void Function(int y, [core.List<core.int> x]) Function(int x) x19; | 123 void Function(int y, [core.List<core.int> x]) Function(int x) x19; |
101 int Function<A>() Function(int x) x20; | 124 int Function<A>() Function(int x) x20; |
102 core.List<core.int> Function<A>(A x) Function(int x) x21; | 125 core.List<core.int> Function<A>(A x) Function(int x) x21; |
103 A Function<A>(List<A> x) Function(int x) x22; | 126 A Function<A>(List<A> x) Function(int x) x22; |
104 | 127 |
105 | |
106 U53({this.tIsBool: false, this.tIsInt: false}) | 128 U53({this.tIsBool: false, this.tIsInt: false}) |
107 : tIsDynamic = !tIsBool && !tIsInt; | 129 : tIsDynamic = !tIsBool && !tIsInt; |
108 | 130 |
109 int m0(int x0, {List<T> x}) => null; | 131 int m0(int x0, {List<T> x}) => null; |
110 List<Function> m1({core.List<core.int> x}) => null; | 132 List<Function> m1({core.List<core.int> x}) => null; |
111 List<T> m2(int x, [List<Function> x0]) => null; | 133 List<T> m2(int x, [List<Function> x0]) => null; |
112 void m3(int x0, [Function x1]) => null; | 134 void m3(int x0, [Function x1]) => null; |
113 List<A> m4<A>() => null; | 135 List<A> m4<A>() => null; |
114 int Function(List<Function> x) m5(int x) => null; | 136 int Function(List<Function> x) m5(int x) => null; |
115 int Function(int y, [List<T> x]) m6(int x) => null; | 137 int Function(int y, [List<T> x]) m6(int x) => null; |
116 Function Function([Function x0]) m7(int x) => null; | 138 Function Function([Function x0]) m7(int x) => null; |
117 Function Function({core.List<core.int> x}) m8(int x) => null; | 139 Function Function({core.List<core.int> x}) m8(int x) => null; |
118 List<Function> Function(int y, {int x}) m9(int x) => null; | 140 List<Function> Function(int y, {int x}) m9(int x) => null; |
119 List<Function> Function(int x0, [core.List<core.int> x]) m10(int x) => null; | 141 List<Function> Function(int x0, [core.List<core.int> x]) m10(int x) => null; |
120 core.List<core.int> Function(int x0) m11(int x) => null; | 142 core.List<core.int> Function(int x0) m11(int x) => null; |
121 core.List<core.int> Function(int x, [List<Function> x0]) m12(int x) => null; | 143 core.List<core.int> Function(int x, [List<Function> x0]) m12(int x) => null; |
122 core.List<core.int> Function(int y, {List<T> x}) m13(int x) => null; | 144 core.List<core.int> Function(int y, {List<T> x}) m13(int x) => null; |
123 List<T> Function([List<Function> x]) m14(int x) => null; | 145 List<T> Function([List<Function> x]) m14(int x) => null; |
124 List<T> Function(List<T> x0) m15(int x) => null; | 146 List<T> Function(List<T> x0) m15(int x) => null; |
125 Function(int x0, [Function x1]) m16(int x) => null; | 147 Function(int x0, [Function x1]) m16(int x) => null; |
126 Function(int x0, {core.List<core.int> x}) m17(int x) => null; | 148 Function(int x0, {core.List<core.int> x}) m17(int x) => null; |
127 void Function(Function x) m18(int x) => null; | 149 void Function(Function x) m18(int x) => null; |
128 void Function(int y, [core.List<core.int> x]) m19(int x) => null; | 150 void Function(int y, [core.List<core.int> x]) m19(int x) => null; |
129 int Function<A>() m20(int x) => null; | 151 int Function<A>() m20(int x) => null; |
130 core.List<core.int> Function<A>(A x) m21(int x) => null; | 152 core.List<core.int> Function<A>(A x) m21(int x) => null; |
131 A Function<A>(List<A> x) m22(int x) => null; | 153 A Function<A>(List<A> x) m22(int x) => null; |
132 | 154 |
133 | |
134 runTests() { | 155 runTests() { |
135 testF0(); | 156 testF0(); |
136 testF1(); | 157 testF1(); |
137 testF2(); | 158 testF2(); |
138 testF3(); | 159 testF3(); |
139 testF4(); | 160 testF4(); |
140 testF5(); | 161 testF5(); |
141 testF6(); | 162 testF6(); |
142 testF7(); | 163 testF7(); |
143 testF8(); | 164 testF8(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 l0 = confuse(m0); | 202 l0 = confuse(m0); |
182 if (!tIsBool) { | 203 if (!tIsBool) { |
183 Expect.isTrue(f0 is F0<int>); | 204 Expect.isTrue(f0 is F0<int>); |
184 Expect.isFalse(f0 is F0<bool>); | 205 Expect.isFalse(f0 is F0<bool>); |
185 Expect.isTrue(confuse(f0) is F0<int>); | 206 Expect.isTrue(confuse(f0) is F0<int>); |
186 Expect.isFalse(confuse(f0) is F0<bool>); | 207 Expect.isFalse(confuse(f0) is F0<bool>); |
187 Expect.equals(tIsDynamic, m0 is F0<bool>); | 208 Expect.equals(tIsDynamic, m0 is F0<bool>); |
188 Expect.equals(tIsDynamic, confuse(m0) is F0<bool>); | 209 Expect.equals(tIsDynamic, confuse(m0) is F0<bool>); |
189 } else { | 210 } else { |
190 if (inCheckedMode) { | 211 if (inCheckedMode) { |
191 Expect.throws(() { x0 = (f0 as dynamic); }); | 212 Expect.throws(() { |
192 Expect.throws(() { x0 = confuse(f0); }); | 213 x0 = (f0 as dynamic); |
| 214 }); |
| 215 Expect.throws(() { |
| 216 x0 = confuse(f0); |
| 217 }); |
193 int Function(int x0, {List<T> x}) l0; | 218 int Function(int x0, {List<T> x}) l0; |
194 Expect.throws(() { l0 = (f0 as dynamic); }); | 219 Expect.throws(() { |
195 Expect.throws(() { l0 = confuse(f0); }); | 220 l0 = (f0 as dynamic); |
| 221 }); |
| 222 Expect.throws(() { |
| 223 l0 = confuse(f0); |
| 224 }); |
196 } | 225 } |
197 int Function(int x0, {List<T> x}) l0 = m0; | 226 int Function(int x0, {List<T> x}) l0 = m0; |
198 // In checked mode, verifies the type. | 227 // In checked mode, verifies the type. |
199 x0 = m0; | 228 x0 = m0; |
200 x0 = confuse(m0); | 229 x0 = confuse(m0); |
201 } | 230 } |
202 } | 231 } |
203 | 232 |
204 /// List<Function> Function({core.List<core.int> x}) | 233 /// List<Function> Function({core.List<core.int> x}) |
205 void testF1() { | 234 void testF1() { |
(...skipping 10 matching lines...) Expand all Loading... |
216 } | 245 } |
217 | 246 |
218 Expect.isTrue(m1 is F1); | 247 Expect.isTrue(m1 is F1); |
219 Expect.isTrue(m1 is List<Function> Function({core.List<core.int> x})); | 248 Expect.isTrue(m1 is List<Function> Function({core.List<core.int> x})); |
220 Expect.isTrue(confuse(m1) is F1); | 249 Expect.isTrue(confuse(m1) is F1); |
221 // In checked mode, verifies the type. | 250 // In checked mode, verifies the type. |
222 x1 = m1; | 251 x1 = m1; |
223 l1 = m1; | 252 l1 = m1; |
224 x1 = confuse(m1); | 253 x1 = confuse(m1); |
225 l1 = confuse(m1); | 254 l1 = confuse(m1); |
226 | |
227 } | 255 } |
228 | 256 |
229 /// List<T> Function(int x, [List<Function> x2]) | 257 /// List<T> Function(int x, [List<Function> x2]) |
230 void testF2() { | 258 void testF2() { |
231 Expect.isTrue(f2 is F2); | 259 Expect.isTrue(f2 is F2); |
232 Expect.isTrue(confuse(f2) is F2); | 260 Expect.isTrue(confuse(f2) is F2); |
233 // In checked mode, verifies the type. | 261 // In checked mode, verifies the type. |
234 List<T> Function(int x, [List<Function> x2]) l2; | 262 List<T> Function(int x, [List<Function> x2]) l2; |
235 // The static function f2 sets `T` to `int`. | 263 // The static function f2 sets `T` to `int`. |
236 if (!tIsBool) { | 264 if (!tIsBool) { |
(...skipping 13 matching lines...) Expand all Loading... |
250 l2 = confuse(m2); | 278 l2 = confuse(m2); |
251 if (!tIsBool) { | 279 if (!tIsBool) { |
252 Expect.isTrue(f2 is F2<int>); | 280 Expect.isTrue(f2 is F2<int>); |
253 Expect.isFalse(f2 is F2<bool>); | 281 Expect.isFalse(f2 is F2<bool>); |
254 Expect.isTrue(confuse(f2) is F2<int>); | 282 Expect.isTrue(confuse(f2) is F2<int>); |
255 Expect.isFalse(confuse(f2) is F2<bool>); | 283 Expect.isFalse(confuse(f2) is F2<bool>); |
256 Expect.equals(tIsDynamic, m2 is F2<bool>); | 284 Expect.equals(tIsDynamic, m2 is F2<bool>); |
257 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); | 285 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); |
258 } else { | 286 } else { |
259 if (inCheckedMode) { | 287 if (inCheckedMode) { |
260 Expect.throws(() { x2 = (f2 as dynamic); }); | 288 Expect.throws(() { |
261 Expect.throws(() { x2 = confuse(f2); }); | 289 x2 = (f2 as dynamic); |
| 290 }); |
| 291 Expect.throws(() { |
| 292 x2 = confuse(f2); |
| 293 }); |
262 List<T> Function(int x, [List<Function> x2]) l2; | 294 List<T> Function(int x, [List<Function> x2]) l2; |
263 Expect.throws(() { l2 = (f2 as dynamic); }); | 295 Expect.throws(() { |
264 Expect.throws(() { l2 = confuse(f2); }); | 296 l2 = (f2 as dynamic); |
| 297 }); |
| 298 Expect.throws(() { |
| 299 l2 = confuse(f2); |
| 300 }); |
265 } | 301 } |
266 List<T> Function(int x, [List<Function> x2]) l2 = m2; | 302 List<T> Function(int x, [List<Function> x2]) l2 = m2; |
267 // In checked mode, verifies the type. | 303 // In checked mode, verifies the type. |
268 x2 = m2; | 304 x2 = m2; |
269 x2 = confuse(m2); | 305 x2 = confuse(m2); |
270 } | 306 } |
271 } | 307 } |
272 | 308 |
273 /// void Function(int x1, [Function x2]) | 309 /// void Function(int x1, [Function x2]) |
274 void testF3() { | 310 void testF3() { |
(...skipping 10 matching lines...) Expand all Loading... |
285 } | 321 } |
286 | 322 |
287 Expect.isTrue(m3 is F3); | 323 Expect.isTrue(m3 is F3); |
288 Expect.isTrue(m3 is void Function(int x1, [Function x2])); | 324 Expect.isTrue(m3 is void Function(int x1, [Function x2])); |
289 Expect.isTrue(confuse(m3) is F3); | 325 Expect.isTrue(confuse(m3) is F3); |
290 // In checked mode, verifies the type. | 326 // In checked mode, verifies the type. |
291 x3 = m3; | 327 x3 = m3; |
292 l3 = m3; | 328 l3 = m3; |
293 x3 = confuse(m3); | 329 x3 = confuse(m3); |
294 l3 = confuse(m3); | 330 l3 = confuse(m3); |
295 | |
296 } | 331 } |
297 | 332 |
298 /// List<A> Function<A>() | 333 /// List<A> Function<A>() |
299 void testF4() { | 334 void testF4() { |
300 Expect.isTrue(f4 is F4); | 335 Expect.isTrue(f4 is F4); |
301 Expect.isTrue(confuse(f4) is F4); | 336 Expect.isTrue(confuse(f4) is F4); |
302 // In checked mode, verifies the type. | 337 // In checked mode, verifies the type. |
303 List<A> Function<A>() l4; | 338 List<A> Function<A>() l4; |
304 // The static function f4 sets `T` to `int`. | 339 // The static function f4 sets `T` to `int`. |
305 if (!tIsBool) { | 340 if (!tIsBool) { |
306 x4 = f4 as dynamic; | 341 x4 = f4 as dynamic; |
307 l4 = f4 as dynamic; | 342 l4 = f4 as dynamic; |
308 x4 = confuse(f4); | 343 x4 = confuse(f4); |
309 l4 = confuse(f4); | 344 l4 = confuse(f4); |
310 } | 345 } |
311 | 346 |
312 Expect.isTrue(m4 is F4); | 347 Expect.isTrue(m4 is F4); |
313 Expect.isTrue(m4 is List<A> Function<A>()); | 348 Expect.isTrue(m4 is List<A> Function<A>()); |
314 Expect.isTrue(confuse(m4) is F4); | 349 Expect.isTrue(confuse(m4) is F4); |
315 // In checked mode, verifies the type. | 350 // In checked mode, verifies the type. |
316 x4 = m4; | 351 x4 = m4; |
317 l4 = m4; | 352 l4 = m4; |
318 x4 = confuse(m4); | 353 x4 = confuse(m4); |
319 l4 = confuse(m4); | 354 l4 = confuse(m4); |
320 | |
321 } | 355 } |
322 | 356 |
323 /// int Function(List<Function> x) Function(int x) | 357 /// int Function(List<Function> x) Function(int x) |
324 void testF5() { | 358 void testF5() { |
325 Expect.isTrue(f5 is F5); | 359 Expect.isTrue(f5 is F5); |
326 Expect.isTrue(confuse(f5) is F5); | 360 Expect.isTrue(confuse(f5) is F5); |
327 // In checked mode, verifies the type. | 361 // In checked mode, verifies the type. |
328 int Function(List<Function> x) Function(int x) l5; | 362 int Function(List<Function> x) Function(int x) l5; |
329 // The static function f5 sets `T` to `int`. | 363 // The static function f5 sets `T` to `int`. |
330 if (!tIsBool) { | 364 if (!tIsBool) { |
331 x5 = f5 as dynamic; | 365 x5 = f5 as dynamic; |
332 l5 = f5 as dynamic; | 366 l5 = f5 as dynamic; |
333 x5 = confuse(f5); | 367 x5 = confuse(f5); |
334 l5 = confuse(f5); | 368 l5 = confuse(f5); |
335 } | 369 } |
336 | 370 |
337 Expect.isTrue(m5 is F5); | 371 Expect.isTrue(m5 is F5); |
338 Expect.isTrue(m5 is int Function(List<Function> x) Function(int x)); | 372 Expect.isTrue(m5 is int Function(List<Function> x) Function(int x)); |
339 Expect.isTrue(confuse(m5) is F5); | 373 Expect.isTrue(confuse(m5) is F5); |
340 // In checked mode, verifies the type. | 374 // In checked mode, verifies the type. |
341 x5 = m5; | 375 x5 = m5; |
342 l5 = m5; | 376 l5 = m5; |
343 x5 = confuse(m5); | 377 x5 = confuse(m5); |
344 l5 = confuse(m5); | 378 l5 = confuse(m5); |
345 | |
346 } | 379 } |
347 | 380 |
348 /// int Function(int y, [List<T> x]) Function(int x) | 381 /// int Function(int y, [List<T> x]) Function(int x) |
349 void testF6() { | 382 void testF6() { |
350 Expect.isTrue(f6 is F6); | 383 Expect.isTrue(f6 is F6); |
351 Expect.isTrue(confuse(f6) is F6); | 384 Expect.isTrue(confuse(f6) is F6); |
352 // In checked mode, verifies the type. | 385 // In checked mode, verifies the type. |
353 int Function(int y, [List<T> x]) Function(int x) l6; | 386 int Function(int y, [List<T> x]) Function(int x) l6; |
354 // The static function f6 sets `T` to `int`. | 387 // The static function f6 sets `T` to `int`. |
355 if (!tIsBool) { | 388 if (!tIsBool) { |
(...skipping 13 matching lines...) Expand all Loading... |
369 l6 = confuse(m6); | 402 l6 = confuse(m6); |
370 if (!tIsBool) { | 403 if (!tIsBool) { |
371 Expect.isTrue(f6 is F6<int>); | 404 Expect.isTrue(f6 is F6<int>); |
372 Expect.isFalse(f6 is F6<bool>); | 405 Expect.isFalse(f6 is F6<bool>); |
373 Expect.isTrue(confuse(f6) is F6<int>); | 406 Expect.isTrue(confuse(f6) is F6<int>); |
374 Expect.isFalse(confuse(f6) is F6<bool>); | 407 Expect.isFalse(confuse(f6) is F6<bool>); |
375 Expect.equals(tIsDynamic, m6 is F6<bool>); | 408 Expect.equals(tIsDynamic, m6 is F6<bool>); |
376 Expect.equals(tIsDynamic, confuse(m6) is F6<bool>); | 409 Expect.equals(tIsDynamic, confuse(m6) is F6<bool>); |
377 } else { | 410 } else { |
378 if (inCheckedMode) { | 411 if (inCheckedMode) { |
379 Expect.throws(() { x6 = (f6 as dynamic); }); | 412 Expect.throws(() { |
380 Expect.throws(() { x6 = confuse(f6); }); | 413 x6 = (f6 as dynamic); |
| 414 }); |
| 415 Expect.throws(() { |
| 416 x6 = confuse(f6); |
| 417 }); |
381 int Function(int y, [List<T> x]) Function(int x) l6; | 418 int Function(int y, [List<T> x]) Function(int x) l6; |
382 Expect.throws(() { l6 = (f6 as dynamic); }); | 419 Expect.throws(() { |
383 Expect.throws(() { l6 = confuse(f6); }); | 420 l6 = (f6 as dynamic); |
| 421 }); |
| 422 Expect.throws(() { |
| 423 l6 = confuse(f6); |
| 424 }); |
384 } | 425 } |
385 int Function(int y, [List<T> x]) Function(int x) l6 = m6; | 426 int Function(int y, [List<T> x]) Function(int x) l6 = m6; |
386 // In checked mode, verifies the type. | 427 // In checked mode, verifies the type. |
387 x6 = m6; | 428 x6 = m6; |
388 x6 = confuse(m6); | 429 x6 = confuse(m6); |
389 } | 430 } |
390 } | 431 } |
391 | 432 |
392 /// Function Function([Function x1]) Function(int x) | 433 /// Function Function([Function x1]) Function(int x) |
393 void testF7() { | 434 void testF7() { |
(...skipping 10 matching lines...) Expand all Loading... |
404 } | 445 } |
405 | 446 |
406 Expect.isTrue(m7 is F7); | 447 Expect.isTrue(m7 is F7); |
407 Expect.isTrue(m7 is Function Function([Function x1]) Function(int x)); | 448 Expect.isTrue(m7 is Function Function([Function x1]) Function(int x)); |
408 Expect.isTrue(confuse(m7) is F7); | 449 Expect.isTrue(confuse(m7) is F7); |
409 // In checked mode, verifies the type. | 450 // In checked mode, verifies the type. |
410 x7 = m7; | 451 x7 = m7; |
411 l7 = m7; | 452 l7 = m7; |
412 x7 = confuse(m7); | 453 x7 = confuse(m7); |
413 l7 = confuse(m7); | 454 l7 = confuse(m7); |
414 | |
415 } | 455 } |
416 | 456 |
417 /// Function Function({core.List<core.int> x}) Function(int x) | 457 /// Function Function({core.List<core.int> x}) Function(int x) |
418 void testF8() { | 458 void testF8() { |
419 Expect.isTrue(f8 is F8); | 459 Expect.isTrue(f8 is F8); |
420 Expect.isTrue(confuse(f8) is F8); | 460 Expect.isTrue(confuse(f8) is F8); |
421 // In checked mode, verifies the type. | 461 // In checked mode, verifies the type. |
422 Function Function({core.List<core.int> x}) Function(int x) l8; | 462 Function Function({core.List<core.int> x}) Function(int x) l8; |
423 // The static function f8 sets `T` to `int`. | 463 // The static function f8 sets `T` to `int`. |
424 if (!tIsBool) { | 464 if (!tIsBool) { |
425 x8 = f8 as dynamic; | 465 x8 = f8 as dynamic; |
426 l8 = f8 as dynamic; | 466 l8 = f8 as dynamic; |
427 x8 = confuse(f8); | 467 x8 = confuse(f8); |
428 l8 = confuse(f8); | 468 l8 = confuse(f8); |
429 } | 469 } |
430 | 470 |
431 Expect.isTrue(m8 is F8); | 471 Expect.isTrue(m8 is F8); |
432 Expect.isTrue(m8 is Function Function({core.List<core.int> x}) Function(int
x)); | 472 Expect.isTrue( |
| 473 m8 is Function Function({core.List<core.int> x}) Function(int x)); |
433 Expect.isTrue(confuse(m8) is F8); | 474 Expect.isTrue(confuse(m8) is F8); |
434 // In checked mode, verifies the type. | 475 // In checked mode, verifies the type. |
435 x8 = m8; | 476 x8 = m8; |
436 l8 = m8; | 477 l8 = m8; |
437 x8 = confuse(m8); | 478 x8 = confuse(m8); |
438 l8 = confuse(m8); | 479 l8 = confuse(m8); |
439 | |
440 } | 480 } |
441 | 481 |
442 /// List<Function> Function(int y, {int x}) Function(int x) | 482 /// List<Function> Function(int y, {int x}) Function(int x) |
443 void testF9() { | 483 void testF9() { |
444 Expect.isTrue(f9 is F9); | 484 Expect.isTrue(f9 is F9); |
445 Expect.isTrue(confuse(f9) is F9); | 485 Expect.isTrue(confuse(f9) is F9); |
446 // In checked mode, verifies the type. | 486 // In checked mode, verifies the type. |
447 List<Function> Function(int y, {int x}) Function(int x) l9; | 487 List<Function> Function(int y, {int x}) Function(int x) l9; |
448 // The static function f9 sets `T` to `int`. | 488 // The static function f9 sets `T` to `int`. |
449 if (!tIsBool) { | 489 if (!tIsBool) { |
450 x9 = f9 as dynamic; | 490 x9 = f9 as dynamic; |
451 l9 = f9 as dynamic; | 491 l9 = f9 as dynamic; |
452 x9 = confuse(f9); | 492 x9 = confuse(f9); |
453 l9 = confuse(f9); | 493 l9 = confuse(f9); |
454 } | 494 } |
455 | 495 |
456 Expect.isTrue(m9 is F9); | 496 Expect.isTrue(m9 is F9); |
457 Expect.isTrue(m9 is List<Function> Function(int y, {int x}) Function(int x))
; | 497 Expect |
| 498 .isTrue(m9 is List<Function> Function(int y, {int x}) Function(int x)); |
458 Expect.isTrue(confuse(m9) is F9); | 499 Expect.isTrue(confuse(m9) is F9); |
459 // In checked mode, verifies the type. | 500 // In checked mode, verifies the type. |
460 x9 = m9; | 501 x9 = m9; |
461 l9 = m9; | 502 l9 = m9; |
462 x9 = confuse(m9); | 503 x9 = confuse(m9); |
463 l9 = confuse(m9); | 504 l9 = confuse(m9); |
464 | |
465 } | 505 } |
466 | 506 |
467 /// List<Function> Function(int x1, [core.List<core.int> x]) Function(int x) | 507 /// List<Function> Function(int x1, [core.List<core.int> x]) Function(int x) |
468 void testF10() { | 508 void testF10() { |
469 Expect.isTrue(f10 is F10); | 509 Expect.isTrue(f10 is F10); |
470 Expect.isTrue(confuse(f10) is F10); | 510 Expect.isTrue(confuse(f10) is F10); |
471 // In checked mode, verifies the type. | 511 // In checked mode, verifies the type. |
472 List<Function> Function(int x1, [core.List<core.int> x]) Function(int x) l10
; | 512 List<Function> Function(int x1, [core.List<core.int> x]) Function(int x) |
| 513 l10; |
473 // The static function f10 sets `T` to `int`. | 514 // The static function f10 sets `T` to `int`. |
474 if (!tIsBool) { | 515 if (!tIsBool) { |
475 x10 = f10 as dynamic; | 516 x10 = f10 as dynamic; |
476 l10 = f10 as dynamic; | 517 l10 = f10 as dynamic; |
477 x10 = confuse(f10); | 518 x10 = confuse(f10); |
478 l10 = confuse(f10); | 519 l10 = confuse(f10); |
479 } | 520 } |
480 | 521 |
481 Expect.isTrue(m10 is F10); | 522 Expect.isTrue(m10 is F10); |
482 Expect.isTrue(m10 is List<Function> Function(int x1, [core.List<core.int> x]
) Function(int x)); | 523 Expect.isTrue(m10 is List<Function> Function(int x1, |
| 524 [core.List<core.int> x]) Function(int x)); |
483 Expect.isTrue(confuse(m10) is F10); | 525 Expect.isTrue(confuse(m10) is F10); |
484 // In checked mode, verifies the type. | 526 // In checked mode, verifies the type. |
485 x10 = m10; | 527 x10 = m10; |
486 l10 = m10; | 528 l10 = m10; |
487 x10 = confuse(m10); | 529 x10 = confuse(m10); |
488 l10 = confuse(m10); | 530 l10 = confuse(m10); |
489 | |
490 } | 531 } |
491 | 532 |
492 /// core.List<core.int> Function(int x1) Function(int x) | 533 /// core.List<core.int> Function(int x1) Function(int x) |
493 void testF11() { | 534 void testF11() { |
494 Expect.isTrue(f11 is F11); | 535 Expect.isTrue(f11 is F11); |
495 Expect.isTrue(confuse(f11) is F11); | 536 Expect.isTrue(confuse(f11) is F11); |
496 // In checked mode, verifies the type. | 537 // In checked mode, verifies the type. |
497 core.List<core.int> Function(int x1) Function(int x) l11; | 538 core.List<core.int> Function(int x1) Function(int x) l11; |
498 // The static function f11 sets `T` to `int`. | 539 // The static function f11 sets `T` to `int`. |
499 if (!tIsBool) { | 540 if (!tIsBool) { |
500 x11 = f11 as dynamic; | 541 x11 = f11 as dynamic; |
501 l11 = f11 as dynamic; | 542 l11 = f11 as dynamic; |
502 x11 = confuse(f11); | 543 x11 = confuse(f11); |
503 l11 = confuse(f11); | 544 l11 = confuse(f11); |
504 } | 545 } |
505 | 546 |
506 Expect.isTrue(m11 is F11); | 547 Expect.isTrue(m11 is F11); |
507 Expect.isTrue(m11 is core.List<core.int> Function(int x1) Function(int x)); | 548 Expect.isTrue(m11 is core.List<core.int> Function(int x1) Function(int x)); |
508 Expect.isTrue(confuse(m11) is F11); | 549 Expect.isTrue(confuse(m11) is F11); |
509 // In checked mode, verifies the type. | 550 // In checked mode, verifies the type. |
510 x11 = m11; | 551 x11 = m11; |
511 l11 = m11; | 552 l11 = m11; |
512 x11 = confuse(m11); | 553 x11 = confuse(m11); |
513 l11 = confuse(m11); | 554 l11 = confuse(m11); |
514 | |
515 } | 555 } |
516 | 556 |
517 /// core.List<core.int> Function(int x, [List<Function> x1]) Function(int x) | 557 /// core.List<core.int> Function(int x, [List<Function> x1]) Function(int x) |
518 void testF12() { | 558 void testF12() { |
519 Expect.isTrue(f12 is F12); | 559 Expect.isTrue(f12 is F12); |
520 Expect.isTrue(confuse(f12) is F12); | 560 Expect.isTrue(confuse(f12) is F12); |
521 // In checked mode, verifies the type. | 561 // In checked mode, verifies the type. |
522 core.List<core.int> Function(int x, [List<Function> x1]) Function(int x) l12
; | 562 core.List<core.int> Function(int x, [List<Function> x1]) Function(int x) |
| 563 l12; |
523 // The static function f12 sets `T` to `int`. | 564 // The static function f12 sets `T` to `int`. |
524 if (!tIsBool) { | 565 if (!tIsBool) { |
525 x12 = f12 as dynamic; | 566 x12 = f12 as dynamic; |
526 l12 = f12 as dynamic; | 567 l12 = f12 as dynamic; |
527 x12 = confuse(f12); | 568 x12 = confuse(f12); |
528 l12 = confuse(f12); | 569 l12 = confuse(f12); |
529 } | 570 } |
530 | 571 |
531 Expect.isTrue(m12 is F12); | 572 Expect.isTrue(m12 is F12); |
532 Expect.isTrue(m12 is core.List<core.int> Function(int x, [List<Function> x1]
) Function(int x)); | 573 Expect.isTrue(m12 is core.List<core.int> Function(int x, |
| 574 [List<Function> x1]) Function(int x)); |
533 Expect.isTrue(confuse(m12) is F12); | 575 Expect.isTrue(confuse(m12) is F12); |
534 // In checked mode, verifies the type. | 576 // In checked mode, verifies the type. |
535 x12 = m12; | 577 x12 = m12; |
536 l12 = m12; | 578 l12 = m12; |
537 x12 = confuse(m12); | 579 x12 = confuse(m12); |
538 l12 = confuse(m12); | 580 l12 = confuse(m12); |
539 | |
540 } | 581 } |
541 | 582 |
542 /// core.List<core.int> Function(int y, {List<T> x}) Function(int x) | 583 /// core.List<core.int> Function(int y, {List<T> x}) Function(int x) |
543 void testF13() { | 584 void testF13() { |
544 Expect.isTrue(f13 is F13); | 585 Expect.isTrue(f13 is F13); |
545 Expect.isTrue(confuse(f13) is F13); | 586 Expect.isTrue(confuse(f13) is F13); |
546 // In checked mode, verifies the type. | 587 // In checked mode, verifies the type. |
547 core.List<core.int> Function(int y, {List<T> x}) Function(int x) l13; | 588 core.List<core.int> Function(int y, {List<T> x}) Function(int x) l13; |
548 // The static function f13 sets `T` to `int`. | 589 // The static function f13 sets `T` to `int`. |
549 if (!tIsBool) { | 590 if (!tIsBool) { |
550 x13 = f13 as dynamic; | 591 x13 = f13 as dynamic; |
551 l13 = f13 as dynamic; | 592 l13 = f13 as dynamic; |
552 x13 = confuse(f13); | 593 x13 = confuse(f13); |
553 l13 = confuse(f13); | 594 l13 = confuse(f13); |
554 } | 595 } |
555 | 596 |
556 Expect.isTrue(m13 is F13); | 597 Expect.isTrue(m13 is F13); |
557 Expect.isTrue(m13 is core.List<core.int> Function(int y, {List<T> x}) Functi
on(int x)); | 598 Expect.isTrue(m13 is core.List<core.int> Function(int y, |
| 599 {List<T> x}) Function(int x)); |
558 Expect.isTrue(confuse(m13) is F13); | 600 Expect.isTrue(confuse(m13) is F13); |
559 // In checked mode, verifies the type. | 601 // In checked mode, verifies the type. |
560 x13 = m13; | 602 x13 = m13; |
561 l13 = m13; | 603 l13 = m13; |
562 x13 = confuse(m13); | 604 x13 = confuse(m13); |
563 l13 = confuse(m13); | 605 l13 = confuse(m13); |
564 if (!tIsBool) { | 606 if (!tIsBool) { |
565 Expect.isTrue(f13 is F13<int>); | 607 Expect.isTrue(f13 is F13<int>); |
566 Expect.isFalse(f13 is F13<bool>); | 608 Expect.isFalse(f13 is F13<bool>); |
567 Expect.isTrue(confuse(f13) is F13<int>); | 609 Expect.isTrue(confuse(f13) is F13<int>); |
568 Expect.isFalse(confuse(f13) is F13<bool>); | 610 Expect.isFalse(confuse(f13) is F13<bool>); |
569 Expect.equals(tIsDynamic, m13 is F13<bool>); | 611 Expect.equals(tIsDynamic, m13 is F13<bool>); |
570 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); | 612 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); |
571 } else { | 613 } else { |
572 if (inCheckedMode) { | 614 if (inCheckedMode) { |
573 Expect.throws(() { x13 = (f13 as dynamic); }); | 615 Expect.throws(() { |
574 Expect.throws(() { x13 = confuse(f13); }); | 616 x13 = (f13 as dynamic); |
| 617 }); |
| 618 Expect.throws(() { |
| 619 x13 = confuse(f13); |
| 620 }); |
575 core.List<core.int> Function(int y, {List<T> x}) Function(int x) l13; | 621 core.List<core.int> Function(int y, {List<T> x}) Function(int x) l13; |
576 Expect.throws(() { l13 = (f13 as dynamic); }); | 622 Expect.throws(() { |
577 Expect.throws(() { l13 = confuse(f13); }); | 623 l13 = (f13 as dynamic); |
| 624 }); |
| 625 Expect.throws(() { |
| 626 l13 = confuse(f13); |
| 627 }); |
578 } | 628 } |
579 core.List<core.int> Function(int y, {List<T> x}) Function(int x) l13 = m13
; | 629 core.List<core.int> Function(int y, {List<T> x}) Function(int x) l13 = |
| 630 m13; |
580 // In checked mode, verifies the type. | 631 // In checked mode, verifies the type. |
581 x13 = m13; | 632 x13 = m13; |
582 x13 = confuse(m13); | 633 x13 = confuse(m13); |
583 } | 634 } |
584 } | 635 } |
585 | 636 |
586 /// List<T> Function([List<Function> x]) Function(int x) | 637 /// List<T> Function([List<Function> x]) Function(int x) |
587 void testF14() { | 638 void testF14() { |
588 Expect.isTrue(f14 is F14); | 639 Expect.isTrue(f14 is F14); |
589 Expect.isTrue(confuse(f14) is F14); | 640 Expect.isTrue(confuse(f14) is F14); |
(...skipping 17 matching lines...) Expand all Loading... |
607 l14 = confuse(m14); | 658 l14 = confuse(m14); |
608 if (!tIsBool) { | 659 if (!tIsBool) { |
609 Expect.isTrue(f14 is F14<int>); | 660 Expect.isTrue(f14 is F14<int>); |
610 Expect.isFalse(f14 is F14<bool>); | 661 Expect.isFalse(f14 is F14<bool>); |
611 Expect.isTrue(confuse(f14) is F14<int>); | 662 Expect.isTrue(confuse(f14) is F14<int>); |
612 Expect.isFalse(confuse(f14) is F14<bool>); | 663 Expect.isFalse(confuse(f14) is F14<bool>); |
613 Expect.equals(tIsDynamic, m14 is F14<bool>); | 664 Expect.equals(tIsDynamic, m14 is F14<bool>); |
614 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); | 665 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); |
615 } else { | 666 } else { |
616 if (inCheckedMode) { | 667 if (inCheckedMode) { |
617 Expect.throws(() { x14 = (f14 as dynamic); }); | 668 Expect.throws(() { |
618 Expect.throws(() { x14 = confuse(f14); }); | 669 x14 = (f14 as dynamic); |
| 670 }); |
| 671 Expect.throws(() { |
| 672 x14 = confuse(f14); |
| 673 }); |
619 List<T> Function([List<Function> x]) Function(int x) l14; | 674 List<T> Function([List<Function> x]) Function(int x) l14; |
620 Expect.throws(() { l14 = (f14 as dynamic); }); | 675 Expect.throws(() { |
621 Expect.throws(() { l14 = confuse(f14); }); | 676 l14 = (f14 as dynamic); |
| 677 }); |
| 678 Expect.throws(() { |
| 679 l14 = confuse(f14); |
| 680 }); |
622 } | 681 } |
623 List<T> Function([List<Function> x]) Function(int x) l14 = m14; | 682 List<T> Function([List<Function> x]) Function(int x) l14 = m14; |
624 // In checked mode, verifies the type. | 683 // In checked mode, verifies the type. |
625 x14 = m14; | 684 x14 = m14; |
626 x14 = confuse(m14); | 685 x14 = confuse(m14); |
627 } | 686 } |
628 } | 687 } |
629 | 688 |
630 /// List<T> Function(List<T> x1) Function(int x) | 689 /// List<T> Function(List<T> x1) Function(int x) |
631 void testF15() { | 690 void testF15() { |
(...skipping 19 matching lines...) Expand all Loading... |
651 l15 = confuse(m15); | 710 l15 = confuse(m15); |
652 if (!tIsBool) { | 711 if (!tIsBool) { |
653 Expect.isTrue(f15 is F15<int>); | 712 Expect.isTrue(f15 is F15<int>); |
654 Expect.isFalse(f15 is F15<bool>); | 713 Expect.isFalse(f15 is F15<bool>); |
655 Expect.isTrue(confuse(f15) is F15<int>); | 714 Expect.isTrue(confuse(f15) is F15<int>); |
656 Expect.isFalse(confuse(f15) is F15<bool>); | 715 Expect.isFalse(confuse(f15) is F15<bool>); |
657 Expect.equals(tIsDynamic, m15 is F15<bool>); | 716 Expect.equals(tIsDynamic, m15 is F15<bool>); |
658 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); | 717 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); |
659 } else { | 718 } else { |
660 if (inCheckedMode) { | 719 if (inCheckedMode) { |
661 Expect.throws(() { x15 = (f15 as dynamic); }); | 720 Expect.throws(() { |
662 Expect.throws(() { x15 = confuse(f15); }); | 721 x15 = (f15 as dynamic); |
| 722 }); |
| 723 Expect.throws(() { |
| 724 x15 = confuse(f15); |
| 725 }); |
663 List<T> Function(List<T> x1) Function(int x) l15; | 726 List<T> Function(List<T> x1) Function(int x) l15; |
664 Expect.throws(() { l15 = (f15 as dynamic); }); | 727 Expect.throws(() { |
665 Expect.throws(() { l15 = confuse(f15); }); | 728 l15 = (f15 as dynamic); |
| 729 }); |
| 730 Expect.throws(() { |
| 731 l15 = confuse(f15); |
| 732 }); |
666 } | 733 } |
667 List<T> Function(List<T> x1) Function(int x) l15 = m15; | 734 List<T> Function(List<T> x1) Function(int x) l15 = m15; |
668 // In checked mode, verifies the type. | 735 // In checked mode, verifies the type. |
669 x15 = m15; | 736 x15 = m15; |
670 x15 = confuse(m15); | 737 x15 = confuse(m15); |
671 } | 738 } |
672 } | 739 } |
673 | 740 |
674 /// Function(int x2, [Function x3]) Function(int x) | 741 /// Function(int x2, [Function x3]) Function(int x) |
675 void testF16() { | 742 void testF16() { |
(...skipping 10 matching lines...) Expand all Loading... |
686 } | 753 } |
687 | 754 |
688 Expect.isTrue(m16 is F16); | 755 Expect.isTrue(m16 is F16); |
689 Expect.isTrue(m16 is Function(int x2, [Function x3]) Function(int x)); | 756 Expect.isTrue(m16 is Function(int x2, [Function x3]) Function(int x)); |
690 Expect.isTrue(confuse(m16) is F16); | 757 Expect.isTrue(confuse(m16) is F16); |
691 // In checked mode, verifies the type. | 758 // In checked mode, verifies the type. |
692 x16 = m16; | 759 x16 = m16; |
693 l16 = m16; | 760 l16 = m16; |
694 x16 = confuse(m16); | 761 x16 = confuse(m16); |
695 l16 = confuse(m16); | 762 l16 = confuse(m16); |
696 | |
697 } | 763 } |
698 | 764 |
699 /// Function(int x1, {core.List<core.int> x}) Function(int x) | 765 /// Function(int x1, {core.List<core.int> x}) Function(int x) |
700 void testF17() { | 766 void testF17() { |
701 Expect.isTrue(f17 is F17); | 767 Expect.isTrue(f17 is F17); |
702 Expect.isTrue(confuse(f17) is F17); | 768 Expect.isTrue(confuse(f17) is F17); |
703 // In checked mode, verifies the type. | 769 // In checked mode, verifies the type. |
704 Function(int x1, {core.List<core.int> x}) Function(int x) l17; | 770 Function(int x1, {core.List<core.int> x}) Function(int x) l17; |
705 // The static function f17 sets `T` to `int`. | 771 // The static function f17 sets `T` to `int`. |
706 if (!tIsBool) { | 772 if (!tIsBool) { |
707 x17 = f17 as dynamic; | 773 x17 = f17 as dynamic; |
708 l17 = f17 as dynamic; | 774 l17 = f17 as dynamic; |
709 x17 = confuse(f17); | 775 x17 = confuse(f17); |
710 l17 = confuse(f17); | 776 l17 = confuse(f17); |
711 } | 777 } |
712 | 778 |
713 Expect.isTrue(m17 is F17); | 779 Expect.isTrue(m17 is F17); |
714 Expect.isTrue(m17 is Function(int x1, {core.List<core.int> x}) Function(int
x)); | 780 Expect.isTrue( |
| 781 m17 is Function(int x1, {core.List<core.int> x}) Function(int x)); |
715 Expect.isTrue(confuse(m17) is F17); | 782 Expect.isTrue(confuse(m17) is F17); |
716 // In checked mode, verifies the type. | 783 // In checked mode, verifies the type. |
717 x17 = m17; | 784 x17 = m17; |
718 l17 = m17; | 785 l17 = m17; |
719 x17 = confuse(m17); | 786 x17 = confuse(m17); |
720 l17 = confuse(m17); | 787 l17 = confuse(m17); |
721 | |
722 } | 788 } |
723 | 789 |
724 /// void Function(Function x) Function(int x) | 790 /// void Function(Function x) Function(int x) |
725 void testF18() { | 791 void testF18() { |
726 Expect.isTrue(f18 is F18); | 792 Expect.isTrue(f18 is F18); |
727 Expect.isTrue(confuse(f18) is F18); | 793 Expect.isTrue(confuse(f18) is F18); |
728 // In checked mode, verifies the type. | 794 // In checked mode, verifies the type. |
729 void Function(Function x) Function(int x) l18; | 795 void Function(Function x) Function(int x) l18; |
730 // The static function f18 sets `T` to `int`. | 796 // The static function f18 sets `T` to `int`. |
731 if (!tIsBool) { | 797 if (!tIsBool) { |
732 x18 = f18 as dynamic; | 798 x18 = f18 as dynamic; |
733 l18 = f18 as dynamic; | 799 l18 = f18 as dynamic; |
734 x18 = confuse(f18); | 800 x18 = confuse(f18); |
735 l18 = confuse(f18); | 801 l18 = confuse(f18); |
736 } | 802 } |
737 | 803 |
738 Expect.isTrue(m18 is F18); | 804 Expect.isTrue(m18 is F18); |
739 Expect.isTrue(m18 is void Function(Function x) Function(int x)); | 805 Expect.isTrue(m18 is void Function(Function x) Function(int x)); |
740 Expect.isTrue(confuse(m18) is F18); | 806 Expect.isTrue(confuse(m18) is F18); |
741 // In checked mode, verifies the type. | 807 // In checked mode, verifies the type. |
742 x18 = m18; | 808 x18 = m18; |
743 l18 = m18; | 809 l18 = m18; |
744 x18 = confuse(m18); | 810 x18 = confuse(m18); |
745 l18 = confuse(m18); | 811 l18 = confuse(m18); |
746 | |
747 } | 812 } |
748 | 813 |
749 /// void Function(int y, [core.List<core.int> x]) Function(int x) | 814 /// void Function(int y, [core.List<core.int> x]) Function(int x) |
750 void testF19() { | 815 void testF19() { |
751 Expect.isTrue(f19 is F19); | 816 Expect.isTrue(f19 is F19); |
752 Expect.isTrue(confuse(f19) is F19); | 817 Expect.isTrue(confuse(f19) is F19); |
753 // In checked mode, verifies the type. | 818 // In checked mode, verifies the type. |
754 void Function(int y, [core.List<core.int> x]) Function(int x) l19; | 819 void Function(int y, [core.List<core.int> x]) Function(int x) l19; |
755 // The static function f19 sets `T` to `int`. | 820 // The static function f19 sets `T` to `int`. |
756 if (!tIsBool) { | 821 if (!tIsBool) { |
757 x19 = f19 as dynamic; | 822 x19 = f19 as dynamic; |
758 l19 = f19 as dynamic; | 823 l19 = f19 as dynamic; |
759 x19 = confuse(f19); | 824 x19 = confuse(f19); |
760 l19 = confuse(f19); | 825 l19 = confuse(f19); |
761 } | 826 } |
762 | 827 |
763 Expect.isTrue(m19 is F19); | 828 Expect.isTrue(m19 is F19); |
764 Expect.isTrue(m19 is void Function(int y, [core.List<core.int> x]) Function(
int x)); | 829 Expect.isTrue( |
| 830 m19 is void Function(int y, [core.List<core.int> x]) Function(int x)); |
765 Expect.isTrue(confuse(m19) is F19); | 831 Expect.isTrue(confuse(m19) is F19); |
766 // In checked mode, verifies the type. | 832 // In checked mode, verifies the type. |
767 x19 = m19; | 833 x19 = m19; |
768 l19 = m19; | 834 l19 = m19; |
769 x19 = confuse(m19); | 835 x19 = confuse(m19); |
770 l19 = confuse(m19); | 836 l19 = confuse(m19); |
771 | |
772 } | 837 } |
773 | 838 |
774 /// int Function<A>() Function(int x) | 839 /// int Function<A>() Function(int x) |
775 void testF20() { | 840 void testF20() { |
776 Expect.isTrue(f20 is F20); | 841 Expect.isTrue(f20 is F20); |
777 Expect.isTrue(confuse(f20) is F20); | 842 Expect.isTrue(confuse(f20) is F20); |
778 // In checked mode, verifies the type. | 843 // In checked mode, verifies the type. |
779 int Function<A>() Function(int x) l20; | 844 int Function<A>() Function(int x) l20; |
780 // The static function f20 sets `T` to `int`. | 845 // The static function f20 sets `T` to `int`. |
781 if (!tIsBool) { | 846 if (!tIsBool) { |
782 x20 = f20 as dynamic; | 847 x20 = f20 as dynamic; |
783 l20 = f20 as dynamic; | 848 l20 = f20 as dynamic; |
784 x20 = confuse(f20); | 849 x20 = confuse(f20); |
785 l20 = confuse(f20); | 850 l20 = confuse(f20); |
786 } | 851 } |
787 | 852 |
788 Expect.isTrue(m20 is F20); | 853 Expect.isTrue(m20 is F20); |
789 Expect.isTrue(m20 is int Function<A>() Function(int x)); | 854 Expect.isTrue(m20 is int Function<A>() Function(int x)); |
790 Expect.isTrue(confuse(m20) is F20); | 855 Expect.isTrue(confuse(m20) is F20); |
791 // In checked mode, verifies the type. | 856 // In checked mode, verifies the type. |
792 x20 = m20; | 857 x20 = m20; |
793 l20 = m20; | 858 l20 = m20; |
794 x20 = confuse(m20); | 859 x20 = confuse(m20); |
795 l20 = confuse(m20); | 860 l20 = confuse(m20); |
796 | |
797 } | 861 } |
798 | 862 |
799 /// core.List<core.int> Function<A>(A x) Function(int x) | 863 /// core.List<core.int> Function<A>(A x) Function(int x) |
800 void testF21() { | 864 void testF21() { |
801 Expect.isTrue(f21 is F21); | 865 Expect.isTrue(f21 is F21); |
802 Expect.isTrue(confuse(f21) is F21); | 866 Expect.isTrue(confuse(f21) is F21); |
803 // In checked mode, verifies the type. | 867 // In checked mode, verifies the type. |
804 core.List<core.int> Function<A>(A x) Function(int x) l21; | 868 core.List<core.int> Function<A>(A x) Function(int x) l21; |
805 // The static function f21 sets `T` to `int`. | 869 // The static function f21 sets `T` to `int`. |
806 if (!tIsBool) { | 870 if (!tIsBool) { |
807 x21 = f21 as dynamic; | 871 x21 = f21 as dynamic; |
808 l21 = f21 as dynamic; | 872 l21 = f21 as dynamic; |
809 x21 = confuse(f21); | 873 x21 = confuse(f21); |
810 l21 = confuse(f21); | 874 l21 = confuse(f21); |
811 } | 875 } |
812 | 876 |
813 Expect.isTrue(m21 is F21); | 877 Expect.isTrue(m21 is F21); |
814 Expect.isTrue(m21 is core.List<core.int> Function<A>(A x) Function(int x)); | 878 Expect.isTrue(m21 is core.List<core.int> Function<A>(A x) Function(int x)); |
815 Expect.isTrue(confuse(m21) is F21); | 879 Expect.isTrue(confuse(m21) is F21); |
816 // In checked mode, verifies the type. | 880 // In checked mode, verifies the type. |
817 x21 = m21; | 881 x21 = m21; |
818 l21 = m21; | 882 l21 = m21; |
819 x21 = confuse(m21); | 883 x21 = confuse(m21); |
820 l21 = confuse(m21); | 884 l21 = confuse(m21); |
821 | |
822 } | 885 } |
823 | 886 |
824 /// A Function<A>(List<A> x) Function(int x) | 887 /// A Function<A>(List<A> x) Function(int x) |
825 void testF22() { | 888 void testF22() { |
826 Expect.isTrue(f22 is F22); | 889 Expect.isTrue(f22 is F22); |
827 Expect.isTrue(confuse(f22) is F22); | 890 Expect.isTrue(confuse(f22) is F22); |
828 // In checked mode, verifies the type. | 891 // In checked mode, verifies the type. |
829 A Function<A>(List<A> x) Function(int x) l22; | 892 A Function<A>(List<A> x) Function(int x) l22; |
830 // The static function f22 sets `T` to `int`. | 893 // The static function f22 sets `T` to `int`. |
831 if (!tIsBool) { | 894 if (!tIsBool) { |
832 x22 = f22 as dynamic; | 895 x22 = f22 as dynamic; |
833 l22 = f22 as dynamic; | 896 l22 = f22 as dynamic; |
834 x22 = confuse(f22); | 897 x22 = confuse(f22); |
835 l22 = confuse(f22); | 898 l22 = confuse(f22); |
836 } | 899 } |
837 | 900 |
838 Expect.isTrue(m22 is F22); | 901 Expect.isTrue(m22 is F22); |
839 Expect.isTrue(m22 is A Function<A>(List<A> x) Function(int x)); | 902 Expect.isTrue(m22 is A Function<A>(List<A> x) Function(int x)); |
840 Expect.isTrue(confuse(m22) is F22); | 903 Expect.isTrue(confuse(m22) is F22); |
841 // In checked mode, verifies the type. | 904 // In checked mode, verifies the type. |
842 x22 = m22; | 905 x22 = m22; |
843 l22 = m22; | 906 l22 = m22; |
844 x22 = confuse(m22); | 907 x22 = confuse(m22); |
845 l22 = confuse(m22); | 908 l22 = confuse(m22); |
846 | |
847 } | 909 } |
848 | |
849 | |
850 } | 910 } |
851 | 911 |
852 void main() { | 912 void main() { |
853 new U53().runTests(); | 913 new U53().runTests(); |
854 new U53<int>(tIsInt: true).runTests(); | 914 new U53<int>(tIsInt: true).runTests(); |
855 new U53<bool>(tIsBool: true).runTests(); | 915 new U53<bool>(tIsBool: true).runTests(); |
856 } | 916 } |
857 | |
OLD | NEW |