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