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 typedef F0<T> = int Function([core.List<core.int> x]); |
23 bool result = false; | 23 typedef F1<T> = List<Function> Function(List<Function> x); |
24 assert(result = true); | 24 typedef F2<T> = List<T> Function(int y, {int x}); |
25 return result; | 25 typedef F3<T> = Function(int y, {List<T> x}); |
26 })(); | 26 typedef F4<T> = Function<A>(List<Function> x); |
27 | 27 typedef F5<T> = int Function(int x2, [Function x3]) |
28 typedef F0<T> | 28 Function<B extends core.int>(); |
29 = int Function([core.List<core.int> x]); | 29 typedef F6<T> = int Function(int x1, {core.List<core.int> x}) |
30 typedef F1<T> | 30 Function<B extends core.int>(); |
31 = List<Function> Function(List<Function> x); | 31 typedef F7<T> = Function Function(Function x) Function<B extends core.int>(); |
32 typedef F2<T> | 32 typedef F8<T> = Function Function(int y, [core.List<core.int> x]) |
33 = List<T> Function(int y, {int x}); | 33 Function<B extends core.int>(); |
34 typedef F3<T> | 34 typedef F9<T> = List<Function> Function([int x1]) |
35 = Function(int y, {List<T> x}); | 35 Function<B extends core.int>(); |
36 typedef F4<T> | 36 typedef F10<T> = List<Function> Function({List<Function> x}) |
37 = Function<A>(List<Function> x); | 37 Function<B extends core.int>(); |
38 typedef F5<T> | 38 typedef F11<T> = List<Function> Function() Function<B extends core.int>(); |
39 = int Function(int x2, [Function x3]) Function<B extends core.int>(); | 39 typedef F12<T> = core.List<core.int> Function(int x1, [List<Function> x]) |
40 typedef F6<T> | 40 Function<B extends core.int>(); |
41 = int Function(int x1, | 41 typedef F13<T> = core.List<core.int> Function([List<T> x1]) |
42 {core.List<core.int> x}) Function<B extends core.int>(); | 42 Function<B extends core.int>(); |
43 typedef F7<T> | 43 typedef F14<T> = List<T> Function(int x, [Function x1]) |
44 = Function Function(Function x) Function<B extends core.int>(); | 44 Function<B extends core.int>(); |
45 typedef F8<T> | 45 typedef F15<T> = List<T> Function(int y, {core.List<core.int> x}) |
46 = Function Function(int y, | 46 Function<B extends core.int>(); |
47 [core.List<core.int> x]) Function<B extends core.int>(); | 47 typedef F16<T> = Function([Function x]) Function<B extends core.int>(); |
48 typedef F9<T> | 48 typedef F17<T> = Function(core.List<core.int> x1) |
49 = List<Function> Function([int x1]) Function<B extends core.int>(); | 49 Function<B extends core.int>(); |
50 typedef F10<T> | 50 typedef F18<T> = void Function(int x2, [int x3]) Function<B extends core.int>(); |
51 = List<Function> Function( | 51 typedef F19<T> = void Function(int x1, {List<Function> x}) |
52 {List<Function> x}) Function<B extends core.int>(); | 52 Function<B extends core.int>(); |
53 typedef F11<T> | 53 typedef F20<T> = int Function<A>(int x) Function<B extends core.int>(); |
54 = List<Function> Function() Function<B extends core.int>(); | 54 typedef F21<T> = core.List<core.int> Function<A>(Function x) |
55 typedef F12<T> | 55 Function<B extends core.int>(); |
56 = core.List<core.int> Function(int x1, | 56 typedef F22<T> = A Function<A>(List<Function> x) Function<B extends core.int>(); |
57 [List<Function> x]) Function<B extends core.int>(); | 57 typedef F23<T> = List<B> Function(B x) Function<B extends core.int>(); |
58 typedef F13<T> | |
59 = core.List<core.int> Function([List<T> x1]) Function<B extends core.int>(); | |
60 typedef F14<T> | |
61 = List<T> Function(int x, [Function x1]) Function<B extends core.int>(); | |
62 typedef F15<T> | |
63 = List<T> Function(int y, | |
64 {core.List<core.int> x}) Function<B extends core.int>(); | |
65 typedef F16<T> | |
66 = Function([Function x]) Function<B extends core.int>(); | |
67 typedef F17<T> | |
68 = Function(core.List<core.int> x1) Function<B extends core.int>(); | |
69 typedef F18<T> | |
70 = void Function(int x2, [int x3]) Function<B extends core.int>(); | |
71 typedef F19<T> | |
72 = void Function(int x1, {List<Function> x}) Function<B extends core.int>(); | |
73 typedef F20<T> | |
74 = int Function<A>(int x) Function<B extends core.int>(); | |
75 typedef F21<T> | |
76 = core.List<core.int> Function<A>( | |
77 Function x) Function<B extends core.int>(); | |
78 typedef F22<T> | |
79 = A Function<A>(List<Function> x) Function<B extends core.int>(); | |
80 typedef F23<T> | |
81 = List<B> Function(B x) Function<B extends core.int>(); | |
82 | 58 |
83 int f0([core.List<core.int> x]) => null; | 59 int f0([core.List<core.int> x]) => null; |
84 List<Function> f1(List<Function> x) => null; | 60 List<Function> f1(List<Function> x) => null; |
85 List<int> f2(int y, {int x}) => null; | 61 List<int> f2(int y, {int x}) => null; |
86 f3(int y, {List<int> x}) => null; | 62 f3(int y, {List<int> x}) => null; |
87 f4<A>(List<Function> x) => null; | 63 f4<A>(List<Function> x) => null; |
88 int Function(int x0, [Function x1]) f5<B extends core.int>() => null; | 64 int Function(int x0, [Function x1]) f5<B extends core.int>() => null; |
89 int Function(int x0, {core.List<core.int> x}) f6<B extends core.int>() => null; | 65 int Function(int x0, {core.List<core.int> x}) f6<B extends core.int>() => null; |
90 Function Function(Function x) f7<B extends core.int>() => null; | 66 Function Function(Function x) f7<B extends core.int>() => null; |
91 Function Function(int y, [core.List<core.int> x]) f8<B extends core.int>() => | 67 Function Function(int y, [core.List<core.int> x]) f8<B extends core.int>() => |
(...skipping 23 matching lines...) Expand all Loading... |
115 | 91 |
116 int Function([core.List<core.int> x]) x0; | 92 int Function([core.List<core.int> x]) x0; |
117 List<Function> Function(List<Function> x) x1; | 93 List<Function> Function(List<Function> x) x1; |
118 List<T> Function(int y, {int x}) x2; | 94 List<T> Function(int y, {int x}) x2; |
119 Function(int y, {List<T> x}) x3; | 95 Function(int y, {List<T> x}) x3; |
120 Function<A>(List<Function> x) x4; | 96 Function<A>(List<Function> x) x4; |
121 int Function(int x2, [Function x3]) Function<B extends core.int>() x5; | 97 int Function(int x2, [Function x3]) Function<B extends core.int>() x5; |
122 int Function(int x1, {core.List<core.int> x}) Function<B extends core.int>() | 98 int Function(int x1, {core.List<core.int> x}) Function<B extends core.int>() |
123 x6; | 99 x6; |
124 Function Function(Function x) Function<B extends core.int>() x7; | 100 Function Function(Function x) Function<B extends core.int>() x7; |
125 Function Function(int y, | 101 Function Function(int y, [core.List<core.int> x]) |
126 [core.List<core.int> x]) Function<B extends core.int>() x8; | 102 Function<B extends core.int>() x8; |
127 List<Function> Function([int x1]) Function<B extends core.int>() x9; | 103 List<Function> Function([int x1]) Function<B extends core.int>() x9; |
128 List<Function> Function({List<Function> x}) Function<B extends core.int>() | 104 List<Function> Function({List<Function> x}) Function<B extends core.int>() |
129 x10; | 105 x10; |
130 List<Function> Function() Function<B extends core.int>() x11; | 106 List<Function> Function() Function<B extends core.int>() x11; |
131 core.List<core.int> Function(int x1, | 107 core.List<core.int> Function(int x1, [List<Function> x]) |
132 [List<Function> x]) Function<B extends core.int>() x12; | 108 Function<B extends core.int>() x12; |
133 core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() x13; | 109 core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() x13; |
134 List<T> Function(int x, [Function x1]) Function<B extends core.int>() x14; | 110 List<T> Function(int x, [Function x1]) Function<B extends core.int>() x14; |
135 List<T> Function(int y, | 111 List<T> Function(int y, {core.List<core.int> x}) |
136 {core.List<core.int> x}) Function<B extends core.int>() x15; | 112 Function<B extends core.int>() x15; |
137 Function([Function x]) Function<B extends core.int>() x16; | 113 Function([Function x]) Function<B extends core.int>() x16; |
138 Function(core.List<core.int> x1) Function<B extends core.int>() x17; | 114 Function(core.List<core.int> x1) Function<B extends core.int>() x17; |
139 void Function(int x2, [int x3]) Function<B extends core.int>() x18; | 115 void Function(int x2, [int x3]) Function<B extends core.int>() x18; |
140 void Function(int x1, {List<Function> x}) Function<B extends core.int>() x19; | 116 void Function(int x1, {List<Function> x}) Function<B extends core.int>() x19; |
141 int Function<A>(int x) Function<B extends core.int>() x20; | 117 int Function<A>(int x) Function<B extends core.int>() x20; |
142 core.List<core.int> Function<A>(Function x) Function<B extends core.int>() | 118 core.List<core.int> Function<A>(Function x) Function<B extends core.int>() |
143 x21; | 119 x21; |
144 A Function<A>(List<Function> x) Function<B extends core.int>() x22; | 120 A Function<A>(List<Function> x) Function<B extends core.int>() x22; |
145 List<B> Function(B x) Function<B extends core.int>() x23; | 121 List<B> Function(B x) Function<B extends core.int>() x23; |
146 | 122 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 x2 = confuse(m2); | 250 x2 = confuse(m2); |
275 l2 = confuse(m2); | 251 l2 = confuse(m2); |
276 if (!tIsBool) { | 252 if (!tIsBool) { |
277 Expect.isTrue(f2 is F2<int>); | 253 Expect.isTrue(f2 is F2<int>); |
278 Expect.isFalse(f2 is F2<bool>); | 254 Expect.isFalse(f2 is F2<bool>); |
279 Expect.isTrue(confuse(f2) is F2<int>); | 255 Expect.isTrue(confuse(f2) is F2<int>); |
280 Expect.isFalse(confuse(f2) is F2<bool>); | 256 Expect.isFalse(confuse(f2) is F2<bool>); |
281 Expect.equals(tIsDynamic, m2 is F2<bool>); | 257 Expect.equals(tIsDynamic, m2 is F2<bool>); |
282 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); | 258 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); |
283 } else { | 259 } else { |
284 if (inCheckedMode) { | 260 if (typeAssertionsEnabled) { |
285 Expect.throws(() { | 261 Expect.throws(() { |
286 x2 = (f2 as dynamic); | 262 x2 = (f2 as dynamic); |
287 }); | 263 }); |
288 Expect.throws(() { | 264 Expect.throws(() { |
289 x2 = confuse(f2); | 265 x2 = confuse(f2); |
290 }); | 266 }); |
291 List<T> Function(int y, {int x}) l2; | 267 List<T> Function(int y, {int x}) l2; |
292 Expect.throws(() { | 268 Expect.throws(() { |
293 l2 = (f2 as dynamic); | 269 l2 = (f2 as dynamic); |
294 }); | 270 }); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 x3 = confuse(m3); | 302 x3 = confuse(m3); |
327 l3 = confuse(m3); | 303 l3 = confuse(m3); |
328 if (!tIsBool) { | 304 if (!tIsBool) { |
329 Expect.isTrue(f3 is F3<int>); | 305 Expect.isTrue(f3 is F3<int>); |
330 Expect.isFalse(f3 is F3<bool>); | 306 Expect.isFalse(f3 is F3<bool>); |
331 Expect.isTrue(confuse(f3) is F3<int>); | 307 Expect.isTrue(confuse(f3) is F3<int>); |
332 Expect.isFalse(confuse(f3) is F3<bool>); | 308 Expect.isFalse(confuse(f3) is F3<bool>); |
333 Expect.equals(tIsDynamic, m3 is F3<bool>); | 309 Expect.equals(tIsDynamic, m3 is F3<bool>); |
334 Expect.equals(tIsDynamic, confuse(m3) is F3<bool>); | 310 Expect.equals(tIsDynamic, confuse(m3) is F3<bool>); |
335 } else { | 311 } else { |
336 if (inCheckedMode) { | 312 if (typeAssertionsEnabled) { |
337 Expect.throws(() { | 313 Expect.throws(() { |
338 x3 = (f3 as dynamic); | 314 x3 = (f3 as dynamic); |
339 }); | 315 }); |
340 Expect.throws(() { | 316 Expect.throws(() { |
341 x3 = confuse(f3); | 317 x3 = confuse(f3); |
342 }); | 318 }); |
343 Function(int y, {List<T> x}) l3; | 319 Function(int y, {List<T> x}) l3; |
344 Expect.throws(() { | 320 Expect.throws(() { |
345 l3 = (f3 as dynamic); | 321 l3 = (f3 as dynamic); |
346 }); | 322 }); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 int Function(int x2, [Function x3]) Function<B extends core.int>() l5; | 363 int Function(int x2, [Function x3]) Function<B extends core.int>() l5; |
388 // The static function f5 sets `T` to `int`. | 364 // The static function f5 sets `T` to `int`. |
389 if (!tIsBool) { | 365 if (!tIsBool) { |
390 x5 = f5 as dynamic; | 366 x5 = f5 as dynamic; |
391 l5 = f5 as dynamic; | 367 l5 = f5 as dynamic; |
392 x5 = confuse(f5); | 368 x5 = confuse(f5); |
393 l5 = confuse(f5); | 369 l5 = confuse(f5); |
394 } | 370 } |
395 | 371 |
396 Expect.isTrue(m5 is F5); | 372 Expect.isTrue(m5 is F5); |
397 Expect.isTrue(m5 is int Function(int x2, | 373 Expect.isTrue(m5 is int Function(int x2, [Function x3]) |
398 [Function x3]) Function<B extends core.int>()); | 374 Function<B extends core.int>()); |
399 Expect.isTrue(confuse(m5) is F5); | 375 Expect.isTrue(confuse(m5) is F5); |
400 // In checked mode, verifies the type. | 376 // In checked mode, verifies the type. |
401 x5 = m5; | 377 x5 = m5; |
402 l5 = m5; | 378 l5 = m5; |
403 x5 = confuse(m5); | 379 x5 = confuse(m5); |
404 l5 = confuse(m5); | 380 l5 = confuse(m5); |
405 } | 381 } |
406 | 382 |
407 /// int Function(int x1, {core.List<core.int> x}) Function<B extends core.int>
() | 383 /// int Function(int x1, {core.List<core.int> x}) Function<B extends core.int>
() |
408 void testF6() { | 384 void testF6() { |
409 Expect.isTrue(f6 is F6); | 385 Expect.isTrue(f6 is F6); |
410 Expect.isTrue(confuse(f6) is F6); | 386 Expect.isTrue(confuse(f6) is F6); |
411 // In checked mode, verifies the type. | 387 // In checked mode, verifies the type. |
412 int Function(int x1, {core.List<core.int> x}) Function<B extends core.int>() | 388 int Function(int x1, {core.List<core.int> x}) Function<B extends core.int>() |
413 l6; | 389 l6; |
414 // The static function f6 sets `T` to `int`. | 390 // The static function f6 sets `T` to `int`. |
415 if (!tIsBool) { | 391 if (!tIsBool) { |
416 x6 = f6 as dynamic; | 392 x6 = f6 as dynamic; |
417 l6 = f6 as dynamic; | 393 l6 = f6 as dynamic; |
418 x6 = confuse(f6); | 394 x6 = confuse(f6); |
419 l6 = confuse(f6); | 395 l6 = confuse(f6); |
420 } | 396 } |
421 | 397 |
422 Expect.isTrue(m6 is F6); | 398 Expect.isTrue(m6 is F6); |
423 Expect.isTrue(m6 is int Function(int x1, | 399 Expect.isTrue(m6 is int Function(int x1, {core.List<core.int> x}) |
424 {core.List<core.int> x}) Function<B extends core.int>()); | 400 Function<B extends core.int>()); |
425 Expect.isTrue(confuse(m6) is F6); | 401 Expect.isTrue(confuse(m6) is F6); |
426 // In checked mode, verifies the type. | 402 // In checked mode, verifies the type. |
427 x6 = m6; | 403 x6 = m6; |
428 l6 = m6; | 404 l6 = m6; |
429 x6 = confuse(m6); | 405 x6 = confuse(m6); |
430 l6 = confuse(m6); | 406 l6 = confuse(m6); |
431 } | 407 } |
432 | 408 |
433 /// Function Function(Function x) Function<B extends core.int>() | 409 /// Function Function(Function x) Function<B extends core.int>() |
434 void testF7() { | 410 void testF7() { |
(...skipping 18 matching lines...) Expand all Loading... |
453 l7 = m7; | 429 l7 = m7; |
454 x7 = confuse(m7); | 430 x7 = confuse(m7); |
455 l7 = confuse(m7); | 431 l7 = confuse(m7); |
456 } | 432 } |
457 | 433 |
458 /// Function Function(int y, [core.List<core.int> x]) Function<B extends core.
int>() | 434 /// Function Function(int y, [core.List<core.int> x]) Function<B extends core.
int>() |
459 void testF8() { | 435 void testF8() { |
460 Expect.isTrue(f8 is F8); | 436 Expect.isTrue(f8 is F8); |
461 Expect.isTrue(confuse(f8) is F8); | 437 Expect.isTrue(confuse(f8) is F8); |
462 // In checked mode, verifies the type. | 438 // In checked mode, verifies the type. |
463 Function Function(int y, | 439 Function Function(int y, [core.List<core.int> x]) |
464 [core.List<core.int> x]) Function<B extends core.int>() l8; | 440 Function<B extends core.int>() l8; |
465 // The static function f8 sets `T` to `int`. | 441 // The static function f8 sets `T` to `int`. |
466 if (!tIsBool) { | 442 if (!tIsBool) { |
467 x8 = f8 as dynamic; | 443 x8 = f8 as dynamic; |
468 l8 = f8 as dynamic; | 444 l8 = f8 as dynamic; |
469 x8 = confuse(f8); | 445 x8 = confuse(f8); |
470 l8 = confuse(f8); | 446 l8 = confuse(f8); |
471 } | 447 } |
472 | 448 |
473 Expect.isTrue(m8 is F8); | 449 Expect.isTrue(m8 is F8); |
474 Expect.isTrue(m8 is Function Function(int y, | 450 Expect.isTrue(m8 is Function Function(int y, [core.List<core.int> x]) |
475 [core.List<core.int> x]) Function<B extends core.int>()); | 451 Function<B extends core.int>()); |
476 Expect.isTrue(confuse(m8) is F8); | 452 Expect.isTrue(confuse(m8) is F8); |
477 // In checked mode, verifies the type. | 453 // In checked mode, verifies the type. |
478 x8 = m8; | 454 x8 = m8; |
479 l8 = m8; | 455 l8 = m8; |
480 x8 = confuse(m8); | 456 x8 = confuse(m8); |
481 l8 = confuse(m8); | 457 l8 = confuse(m8); |
482 } | 458 } |
483 | 459 |
484 /// List<Function> Function([int x1]) Function<B extends core.int>() | 460 /// List<Function> Function([int x1]) Function<B extends core.int>() |
485 void testF9() { | 461 void testF9() { |
(...skipping 29 matching lines...) Expand all Loading... |
515 l10; | 491 l10; |
516 // The static function f10 sets `T` to `int`. | 492 // The static function f10 sets `T` to `int`. |
517 if (!tIsBool) { | 493 if (!tIsBool) { |
518 x10 = f10 as dynamic; | 494 x10 = f10 as dynamic; |
519 l10 = f10 as dynamic; | 495 l10 = f10 as dynamic; |
520 x10 = confuse(f10); | 496 x10 = confuse(f10); |
521 l10 = confuse(f10); | 497 l10 = confuse(f10); |
522 } | 498 } |
523 | 499 |
524 Expect.isTrue(m10 is F10); | 500 Expect.isTrue(m10 is F10); |
525 Expect.isTrue(m10 is List<Function> Function( | 501 Expect.isTrue(m10 is List<Function> Function({List<Function> x}) |
526 {List<Function> x}) Function<B extends core.int>()); | 502 Function<B extends core.int>()); |
527 Expect.isTrue(confuse(m10) is F10); | 503 Expect.isTrue(confuse(m10) is F10); |
528 // In checked mode, verifies the type. | 504 // In checked mode, verifies the type. |
529 x10 = m10; | 505 x10 = m10; |
530 l10 = m10; | 506 l10 = m10; |
531 x10 = confuse(m10); | 507 x10 = confuse(m10); |
532 l10 = confuse(m10); | 508 l10 = confuse(m10); |
533 } | 509 } |
534 | 510 |
535 /// List<Function> Function() Function<B extends core.int>() | 511 /// List<Function> Function() Function<B extends core.int>() |
536 void testF11() { | 512 void testF11() { |
(...skipping 18 matching lines...) Expand all Loading... |
555 l11 = m11; | 531 l11 = m11; |
556 x11 = confuse(m11); | 532 x11 = confuse(m11); |
557 l11 = confuse(m11); | 533 l11 = confuse(m11); |
558 } | 534 } |
559 | 535 |
560 /// core.List<core.int> Function(int x1, [List<Function> x]) Function<B extend
s core.int>() | 536 /// core.List<core.int> Function(int x1, [List<Function> x]) Function<B extend
s core.int>() |
561 void testF12() { | 537 void testF12() { |
562 Expect.isTrue(f12 is F12); | 538 Expect.isTrue(f12 is F12); |
563 Expect.isTrue(confuse(f12) is F12); | 539 Expect.isTrue(confuse(f12) is F12); |
564 // In checked mode, verifies the type. | 540 // In checked mode, verifies the type. |
565 core.List<core.int> Function(int x1, | 541 core.List<core.int> Function(int x1, [List<Function> x]) |
566 [List<Function> x]) Function<B extends core.int>() l12; | 542 Function<B extends core.int>() l12; |
567 // The static function f12 sets `T` to `int`. | 543 // The static function f12 sets `T` to `int`. |
568 if (!tIsBool) { | 544 if (!tIsBool) { |
569 x12 = f12 as dynamic; | 545 x12 = f12 as dynamic; |
570 l12 = f12 as dynamic; | 546 l12 = f12 as dynamic; |
571 x12 = confuse(f12); | 547 x12 = confuse(f12); |
572 l12 = confuse(f12); | 548 l12 = confuse(f12); |
573 } | 549 } |
574 | 550 |
575 Expect.isTrue(m12 is F12); | 551 Expect.isTrue(m12 is F12); |
576 Expect.isTrue(m12 is core.List<core.int> Function(int x1, | 552 Expect.isTrue(m12 is core.List<core.int> Function(int x1, |
577 [List<Function> x]) Function<B extends core.int>()); | 553 [List<Function> x]) |
| 554 Function<B extends core.int>()); |
578 Expect.isTrue(confuse(m12) is F12); | 555 Expect.isTrue(confuse(m12) is F12); |
579 // In checked mode, verifies the type. | 556 // In checked mode, verifies the type. |
580 x12 = m12; | 557 x12 = m12; |
581 l12 = m12; | 558 l12 = m12; |
582 x12 = confuse(m12); | 559 x12 = confuse(m12); |
583 l12 = confuse(m12); | 560 l12 = confuse(m12); |
584 } | 561 } |
585 | 562 |
586 /// core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() | 563 /// core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() |
587 void testF13() { | 564 void testF13() { |
588 Expect.isTrue(f13 is F13); | 565 Expect.isTrue(f13 is F13); |
589 Expect.isTrue(confuse(f13) is F13); | 566 Expect.isTrue(confuse(f13) is F13); |
590 // In checked mode, verifies the type. | 567 // In checked mode, verifies the type. |
591 core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() | 568 core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() |
592 l13; | 569 l13; |
593 // The static function f13 sets `T` to `int`. | 570 // The static function f13 sets `T` to `int`. |
594 if (!tIsBool) { | 571 if (!tIsBool) { |
595 x13 = f13 as dynamic; | 572 x13 = f13 as dynamic; |
596 l13 = f13 as dynamic; | 573 l13 = f13 as dynamic; |
597 x13 = confuse(f13); | 574 x13 = confuse(f13); |
598 l13 = confuse(f13); | 575 l13 = confuse(f13); |
599 } | 576 } |
600 | 577 |
601 Expect.isTrue(m13 is F13); | 578 Expect.isTrue(m13 is F13); |
602 Expect.isTrue(m13 is core.List<core.int> Function( | 579 Expect.isTrue(m13 is core.List<core.int> Function([List<T> x1]) |
603 [List<T> x1]) Function<B extends core.int>()); | 580 Function<B extends core.int>()); |
604 Expect.isTrue(confuse(m13) is F13); | 581 Expect.isTrue(confuse(m13) is F13); |
605 // In checked mode, verifies the type. | 582 // In checked mode, verifies the type. |
606 x13 = m13; | 583 x13 = m13; |
607 l13 = m13; | 584 l13 = m13; |
608 x13 = confuse(m13); | 585 x13 = confuse(m13); |
609 l13 = confuse(m13); | 586 l13 = confuse(m13); |
610 if (!tIsBool) { | 587 if (!tIsBool) { |
611 Expect.isTrue(f13 is F13<int>); | 588 Expect.isTrue(f13 is F13<int>); |
612 Expect.isFalse(f13 is F13<bool>); | 589 Expect.isFalse(f13 is F13<bool>); |
613 Expect.isTrue(confuse(f13) is F13<int>); | 590 Expect.isTrue(confuse(f13) is F13<int>); |
614 Expect.isFalse(confuse(f13) is F13<bool>); | 591 Expect.isFalse(confuse(f13) is F13<bool>); |
615 Expect.equals(tIsDynamic, m13 is F13<bool>); | 592 Expect.equals(tIsDynamic, m13 is F13<bool>); |
616 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); | 593 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); |
617 } else { | 594 } else { |
618 if (inCheckedMode) { | 595 if (typeAssertionsEnabled) { |
619 Expect.throws(() { | 596 Expect.throws(() { |
620 x13 = (f13 as dynamic); | 597 x13 = (f13 as dynamic); |
621 }); | 598 }); |
622 Expect.throws(() { | 599 Expect.throws(() { |
623 x13 = confuse(f13); | 600 x13 = confuse(f13); |
624 }); | 601 }); |
625 core.List<core.int> Function( | 602 core.List<core.int> Function([List<T> x1]) |
626 [List<T> x1]) Function<B extends core.int>() l13; | 603 Function<B extends core.int>() l13; |
627 Expect.throws(() { | 604 Expect.throws(() { |
628 l13 = (f13 as dynamic); | 605 l13 = (f13 as dynamic); |
629 }); | 606 }); |
630 Expect.throws(() { | 607 Expect.throws(() { |
631 l13 = confuse(f13); | 608 l13 = confuse(f13); |
632 }); | 609 }); |
633 } | 610 } |
634 core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() | 611 core.List<core.int> Function([List<T> x1]) Function<B extends core.int>() |
635 l13 = m13; | 612 l13 = m13; |
636 // In checked mode, verifies the type. | 613 // In checked mode, verifies the type. |
(...skipping 10 matching lines...) Expand all Loading... |
647 List<T> Function(int x, [Function x1]) Function<B extends core.int>() l14; | 624 List<T> Function(int x, [Function x1]) Function<B extends core.int>() l14; |
648 // The static function f14 sets `T` to `int`. | 625 // The static function f14 sets `T` to `int`. |
649 if (!tIsBool) { | 626 if (!tIsBool) { |
650 x14 = f14 as dynamic; | 627 x14 = f14 as dynamic; |
651 l14 = f14 as dynamic; | 628 l14 = f14 as dynamic; |
652 x14 = confuse(f14); | 629 x14 = confuse(f14); |
653 l14 = confuse(f14); | 630 l14 = confuse(f14); |
654 } | 631 } |
655 | 632 |
656 Expect.isTrue(m14 is F14); | 633 Expect.isTrue(m14 is F14); |
657 Expect.isTrue(m14 is List<T> Function(int x, | 634 Expect.isTrue(m14 is List<T> Function(int x, [Function x1]) |
658 [Function x1]) Function<B extends core.int>()); | 635 Function<B extends core.int>()); |
659 Expect.isTrue(confuse(m14) is F14); | 636 Expect.isTrue(confuse(m14) is F14); |
660 // In checked mode, verifies the type. | 637 // In checked mode, verifies the type. |
661 x14 = m14; | 638 x14 = m14; |
662 l14 = m14; | 639 l14 = m14; |
663 x14 = confuse(m14); | 640 x14 = confuse(m14); |
664 l14 = confuse(m14); | 641 l14 = confuse(m14); |
665 if (!tIsBool) { | 642 if (!tIsBool) { |
666 Expect.isTrue(f14 is F14<int>); | 643 Expect.isTrue(f14 is F14<int>); |
667 Expect.isFalse(f14 is F14<bool>); | 644 Expect.isFalse(f14 is F14<bool>); |
668 Expect.isTrue(confuse(f14) is F14<int>); | 645 Expect.isTrue(confuse(f14) is F14<int>); |
669 Expect.isFalse(confuse(f14) is F14<bool>); | 646 Expect.isFalse(confuse(f14) is F14<bool>); |
670 Expect.equals(tIsDynamic, m14 is F14<bool>); | 647 Expect.equals(tIsDynamic, m14 is F14<bool>); |
671 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); | 648 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); |
672 } else { | 649 } else { |
673 if (inCheckedMode) { | 650 if (typeAssertionsEnabled) { |
674 Expect.throws(() { | 651 Expect.throws(() { |
675 x14 = (f14 as dynamic); | 652 x14 = (f14 as dynamic); |
676 }); | 653 }); |
677 Expect.throws(() { | 654 Expect.throws(() { |
678 x14 = confuse(f14); | 655 x14 = confuse(f14); |
679 }); | 656 }); |
680 List<T> Function(int x, [Function x1]) Function<B extends core.int>() | 657 List<T> Function(int x, [Function x1]) Function<B extends core.int>() |
681 l14; | 658 l14; |
682 Expect.throws(() { | 659 Expect.throws(() { |
683 l14 = (f14 as dynamic); | 660 l14 = (f14 as dynamic); |
684 }); | 661 }); |
685 Expect.throws(() { | 662 Expect.throws(() { |
686 l14 = confuse(f14); | 663 l14 = confuse(f14); |
687 }); | 664 }); |
688 } | 665 } |
689 List<T> Function(int x, [Function x1]) Function<B extends core.int>() | 666 List<T> Function(int x, [Function x1]) Function<B extends core.int>() |
690 l14 = m14; | 667 l14 = m14; |
691 // In checked mode, verifies the type. | 668 // In checked mode, verifies the type. |
692 x14 = m14; | 669 x14 = m14; |
693 x14 = confuse(m14); | 670 x14 = confuse(m14); |
694 } | 671 } |
695 } | 672 } |
696 | 673 |
697 /// List<T> Function(int y, {core.List<core.int> x}) Function<B extends core.i
nt>() | 674 /// List<T> Function(int y, {core.List<core.int> x}) Function<B extends core.i
nt>() |
698 void testF15() { | 675 void testF15() { |
699 Expect.isTrue(f15 is F15); | 676 Expect.isTrue(f15 is F15); |
700 Expect.isTrue(confuse(f15) is F15); | 677 Expect.isTrue(confuse(f15) is F15); |
701 // In checked mode, verifies the type. | 678 // In checked mode, verifies the type. |
702 List<T> Function(int y, | 679 List<T> Function(int y, {core.List<core.int> x}) |
703 {core.List<core.int> x}) Function<B extends core.int>() l15; | 680 Function<B extends core.int>() l15; |
704 // The static function f15 sets `T` to `int`. | 681 // The static function f15 sets `T` to `int`. |
705 if (!tIsBool) { | 682 if (!tIsBool) { |
706 x15 = f15 as dynamic; | 683 x15 = f15 as dynamic; |
707 l15 = f15 as dynamic; | 684 l15 = f15 as dynamic; |
708 x15 = confuse(f15); | 685 x15 = confuse(f15); |
709 l15 = confuse(f15); | 686 l15 = confuse(f15); |
710 } | 687 } |
711 | 688 |
712 Expect.isTrue(m15 is F15); | 689 Expect.isTrue(m15 is F15); |
713 Expect.isTrue(m15 is List<T> Function(int y, | 690 Expect.isTrue(m15 is List<T> Function(int y, {core.List<core.int> x}) |
714 {core.List<core.int> x}) Function<B extends core.int>()); | 691 Function<B extends core.int>()); |
715 Expect.isTrue(confuse(m15) is F15); | 692 Expect.isTrue(confuse(m15) is F15); |
716 // In checked mode, verifies the type. | 693 // In checked mode, verifies the type. |
717 x15 = m15; | 694 x15 = m15; |
718 l15 = m15; | 695 l15 = m15; |
719 x15 = confuse(m15); | 696 x15 = confuse(m15); |
720 l15 = confuse(m15); | 697 l15 = confuse(m15); |
721 if (!tIsBool) { | 698 if (!tIsBool) { |
722 Expect.isTrue(f15 is F15<int>); | 699 Expect.isTrue(f15 is F15<int>); |
723 Expect.isFalse(f15 is F15<bool>); | 700 Expect.isFalse(f15 is F15<bool>); |
724 Expect.isTrue(confuse(f15) is F15<int>); | 701 Expect.isTrue(confuse(f15) is F15<int>); |
725 Expect.isFalse(confuse(f15) is F15<bool>); | 702 Expect.isFalse(confuse(f15) is F15<bool>); |
726 Expect.equals(tIsDynamic, m15 is F15<bool>); | 703 Expect.equals(tIsDynamic, m15 is F15<bool>); |
727 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); | 704 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); |
728 } else { | 705 } else { |
729 if (inCheckedMode) { | 706 if (typeAssertionsEnabled) { |
730 Expect.throws(() { | 707 Expect.throws(() { |
731 x15 = (f15 as dynamic); | 708 x15 = (f15 as dynamic); |
732 }); | 709 }); |
733 Expect.throws(() { | 710 Expect.throws(() { |
734 x15 = confuse(f15); | 711 x15 = confuse(f15); |
735 }); | 712 }); |
736 List<T> Function(int y, | 713 List<T> Function(int y, {core.List<core.int> x}) |
737 {core.List<core.int> x}) Function<B extends core.int>() l15; | 714 Function<B extends core.int>() l15; |
738 Expect.throws(() { | 715 Expect.throws(() { |
739 l15 = (f15 as dynamic); | 716 l15 = (f15 as dynamic); |
740 }); | 717 }); |
741 Expect.throws(() { | 718 Expect.throws(() { |
742 l15 = confuse(f15); | 719 l15 = confuse(f15); |
743 }); | 720 }); |
744 } | 721 } |
745 List<T> Function(int y, | 722 List<T> Function(int y, {core.List<core.int> x}) |
746 {core.List<core.int> x}) Function<B extends core.int>() l15 = m15; | 723 Function<B extends core.int>() l15 = m15; |
747 // In checked mode, verifies the type. | 724 // In checked mode, verifies the type. |
748 x15 = m15; | 725 x15 = m15; |
749 x15 = confuse(m15); | 726 x15 = confuse(m15); |
750 } | 727 } |
751 } | 728 } |
752 | 729 |
753 /// Function([Function x]) Function<B extends core.int>() | 730 /// Function([Function x]) Function<B extends core.int>() |
754 void testF16() { | 731 void testF16() { |
755 Expect.isTrue(f16 is F16); | 732 Expect.isTrue(f16 is F16); |
756 Expect.isTrue(confuse(f16) is F16); | 733 Expect.isTrue(confuse(f16) is F16); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 l19; | 810 l19; |
834 // The static function f19 sets `T` to `int`. | 811 // The static function f19 sets `T` to `int`. |
835 if (!tIsBool) { | 812 if (!tIsBool) { |
836 x19 = f19 as dynamic; | 813 x19 = f19 as dynamic; |
837 l19 = f19 as dynamic; | 814 l19 = f19 as dynamic; |
838 x19 = confuse(f19); | 815 x19 = confuse(f19); |
839 l19 = confuse(f19); | 816 l19 = confuse(f19); |
840 } | 817 } |
841 | 818 |
842 Expect.isTrue(m19 is F19); | 819 Expect.isTrue(m19 is F19); |
843 Expect.isTrue(m19 is void Function(int x1, | 820 Expect.isTrue(m19 is void Function(int x1, {List<Function> x}) |
844 {List<Function> x}) Function<B extends core.int>()); | 821 Function<B extends core.int>()); |
845 Expect.isTrue(confuse(m19) is F19); | 822 Expect.isTrue(confuse(m19) is F19); |
846 // In checked mode, verifies the type. | 823 // In checked mode, verifies the type. |
847 x19 = m19; | 824 x19 = m19; |
848 l19 = m19; | 825 l19 = m19; |
849 x19 = confuse(m19); | 826 x19 = confuse(m19); |
850 l19 = confuse(m19); | 827 l19 = confuse(m19); |
851 } | 828 } |
852 | 829 |
853 /// int Function<A>(int x) Function<B extends core.int>() | 830 /// int Function<A>(int x) Function<B extends core.int>() |
854 void testF20() { | 831 void testF20() { |
(...skipping 28 matching lines...) Expand all Loading... |
883 l21; | 860 l21; |
884 // The static function f21 sets `T` to `int`. | 861 // The static function f21 sets `T` to `int`. |
885 if (!tIsBool) { | 862 if (!tIsBool) { |
886 x21 = f21 as dynamic; | 863 x21 = f21 as dynamic; |
887 l21 = f21 as dynamic; | 864 l21 = f21 as dynamic; |
888 x21 = confuse(f21); | 865 x21 = confuse(f21); |
889 l21 = confuse(f21); | 866 l21 = confuse(f21); |
890 } | 867 } |
891 | 868 |
892 Expect.isTrue(m21 is F21); | 869 Expect.isTrue(m21 is F21); |
893 Expect.isTrue(m21 is core.List<core.int> Function<A>( | 870 Expect.isTrue(m21 is core.List<core.int> Function<A>(Function x) |
894 Function x) Function<B extends core.int>()); | 871 Function<B extends core.int>()); |
895 Expect.isTrue(confuse(m21) is F21); | 872 Expect.isTrue(confuse(m21) is F21); |
896 // In checked mode, verifies the type. | 873 // In checked mode, verifies the type. |
897 x21 = m21; | 874 x21 = m21; |
898 l21 = m21; | 875 l21 = m21; |
899 x21 = confuse(m21); | 876 x21 = confuse(m21); |
900 l21 = confuse(m21); | 877 l21 = confuse(m21); |
901 } | 878 } |
902 | 879 |
903 /// A Function<A>(List<Function> x) Function<B extends core.int>() | 880 /// A Function<A>(List<Function> x) Function<B extends core.int>() |
904 void testF22() { | 881 void testF22() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 x23 = confuse(m23); | 925 x23 = confuse(m23); |
949 l23 = confuse(m23); | 926 l23 = confuse(m23); |
950 } | 927 } |
951 } | 928 } |
952 | 929 |
953 void main() { | 930 void main() { |
954 new U34().runTests(); | 931 new U34().runTests(); |
955 new U34<int>(tIsInt: true).runTests(); | 932 new U34<int>(tIsInt: true).runTests(); |
956 new U34<bool>(tIsBool: true).runTests(); | 933 new U34<bool>(tIsBool: true).runTests(); |
957 } | 934 } |
OLD | NEW |