| 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([int x1]); |
| 23 bool result = false; | 23 typedef F1<T> = Function Function([List<T> x1]); |
| 24 assert(result = true); | 24 typedef F2<T> = core.List<core.int> Function(core.List<core.int> x0); |
| 25 return result; | 25 typedef F3<T> = Function(int y, [List<Function> x]); |
| 26 })(); | 26 typedef F4<T> = Function Function<A>(); |
| 27 | 27 typedef F5<T> = int Function(int y, {int x}) Function(int x); |
| 28 typedef F0<T> | 28 typedef F6<T> = int Function(int x1, [core.List<core.int> x]) Function(int x); |
| 29 = int Function([int x1]); | 29 typedef F7<T> = Function Function(int x1) Function(int x); |
| 30 typedef F1<T> | 30 typedef F8<T> = Function Function(int x, [List<Function> x1]) Function(int x); |
| 31 = Function Function([List<T> x1]); | 31 typedef F9<T> = Function Function(int y, {List<T> x}) Function(int x); |
| 32 typedef F2<T> | 32 typedef F10<T> = List<Function> Function([List<Function> x]) Function(int x); |
| 33 = core.List<core.int> Function(core.List<core.int> x0); | 33 typedef F11<T> = List<Function> Function(List<T> x1) Function(int x); |
| 34 typedef F3<T> | 34 typedef F12<T> = core.List<core.int> Function(int x2, [Function x3]) Function( |
| 35 = Function(int y, [List<Function> x]); | 35 int x); |
| 36 typedef F4<T> | 36 typedef F13<T> = core.List<core.int> Function(int x1, {core.List<core.int> x}) |
| 37 = Function Function<A>(); | 37 Function(int x); |
| 38 typedef F5<T> | 38 typedef F14<T> = List<T> Function(Function x) Function(int x); |
| 39 = int Function(int y, {int x}) Function(int x); | 39 typedef F15<T> = List<T> Function(int y, [core.List<core.int> x]) Function( |
| 40 typedef F6<T> | 40 int x); |
| 41 = int Function(int x1, [core.List<core.int> x]) Function(int x); | 41 typedef F16<T> = Function([int x1]) Function(int x); |
| 42 typedef F7<T> | 42 typedef F17<T> = Function({List<Function> x}) Function(int x); |
| 43 = Function Function(int x1) Function(int x); | 43 typedef F18<T> = Function() Function(int x); |
| 44 typedef F8<T> | 44 typedef F19<T> = void Function(int x1, [List<Function> x]) Function(int x); |
| 45 = Function Function(int x, [List<Function> x1]) Function(int x); | 45 typedef F20<T> = void Function([List<T> x1]) Function(int x); |
| 46 typedef F9<T> | 46 typedef F21<T> = List<Function> Function<A>(List<Function> x) Function(int x); |
| 47 = Function Function(int y, {List<T> x}) Function(int x); | 47 typedef F22<T> = Function<A>(core.List<core.int> x) Function(int x); |
| 48 typedef F10<T> | 48 typedef F23<T> = void Function<A>(List<T> x) Function(int x); |
| 49 = List<Function> Function([List<Function> x]) Function(int x); | |
| 50 typedef F11<T> | |
| 51 = List<Function> Function(List<T> x1) Function(int x); | |
| 52 typedef F12<T> | |
| 53 = core.List<core.int> Function(int x2, [Function x3]) Function(int x); | |
| 54 typedef F13<T> | |
| 55 = core.List<core.int> Function(int x1, {core.List<core.int> x}) Function( | |
| 56 int x); | |
| 57 typedef F14<T> | |
| 58 = List<T> Function(Function x) Function(int x); | |
| 59 typedef F15<T> | |
| 60 = List<T> Function(int y, [core.List<core.int> x]) Function(int x); | |
| 61 typedef F16<T> | |
| 62 = Function([int x1]) Function(int x); | |
| 63 typedef F17<T> | |
| 64 = Function({List<Function> x}) Function(int x); | |
| 65 typedef F18<T> | |
| 66 = Function() Function(int x); | |
| 67 typedef F19<T> | |
| 68 = void Function(int x1, [List<Function> x]) Function(int x); | |
| 69 typedef F20<T> | |
| 70 = void Function([List<T> x1]) Function(int x); | |
| 71 typedef F21<T> | |
| 72 = List<Function> Function<A>(List<Function> x) Function(int x); | |
| 73 typedef F22<T> | |
| 74 = Function<A>(core.List<core.int> x) Function(int x); | |
| 75 typedef F23<T> | |
| 76 = void Function<A>(List<T> x) Function(int x); | |
| 77 | 49 |
| 78 int f0([int x0]) => null; | 50 int f0([int x0]) => null; |
| 79 Function f1([List<int> x0]) => null; | 51 Function f1([List<int> x0]) => null; |
| 80 core.List<core.int> f2(core.List<core.int> x0) => null; | 52 core.List<core.int> f2(core.List<core.int> x0) => null; |
| 81 f3(int y, [List<Function> x]) => null; | 53 f3(int y, [List<Function> x]) => null; |
| 82 Function f4<A>() => null; | 54 Function f4<A>() => null; |
| 83 int Function(int y, {int x}) f5(int x) => null; | 55 int Function(int y, {int x}) f5(int x) => null; |
| 84 int Function(int x0, [core.List<core.int> x]) f6(int x) => null; | 56 int Function(int x0, [core.List<core.int> x]) f6(int x) => null; |
| 85 Function Function(int x0) f7(int x) => null; | 57 Function Function(int x0) f7(int x) => null; |
| 86 Function Function(int x, [List<Function> x0]) f8(int x) => null; | 58 Function Function(int x, [List<Function> x0]) f8(int x) => null; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 x1 = confuse(m1); | 207 x1 = confuse(m1); |
| 236 l1 = confuse(m1); | 208 l1 = confuse(m1); |
| 237 if (!tIsBool) { | 209 if (!tIsBool) { |
| 238 Expect.isTrue(f1 is F1<int>); | 210 Expect.isTrue(f1 is F1<int>); |
| 239 Expect.isFalse(f1 is F1<bool>); | 211 Expect.isFalse(f1 is F1<bool>); |
| 240 Expect.isTrue(confuse(f1) is F1<int>); | 212 Expect.isTrue(confuse(f1) is F1<int>); |
| 241 Expect.isFalse(confuse(f1) is F1<bool>); | 213 Expect.isFalse(confuse(f1) is F1<bool>); |
| 242 Expect.equals(tIsDynamic, m1 is F1<bool>); | 214 Expect.equals(tIsDynamic, m1 is F1<bool>); |
| 243 Expect.equals(tIsDynamic, confuse(m1) is F1<bool>); | 215 Expect.equals(tIsDynamic, confuse(m1) is F1<bool>); |
| 244 } else { | 216 } else { |
| 245 if (inCheckedMode) { | 217 if (typeAssertionsEnabled) { |
| 246 Expect.throws(() { | 218 Expect.throws(() { |
| 247 x1 = (f1 as dynamic); | 219 x1 = (f1 as dynamic); |
| 248 }); | 220 }); |
| 249 Expect.throws(() { | 221 Expect.throws(() { |
| 250 x1 = confuse(f1); | 222 x1 = confuse(f1); |
| 251 }); | 223 }); |
| 252 Function Function([List<T> x1]) l1; | 224 Function Function([List<T> x1]) l1; |
| 253 Expect.throws(() { | 225 Expect.throws(() { |
| 254 l1 = (f1 as dynamic); | 226 l1 = (f1 as dynamic); |
| 255 }); | 227 }); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 x9 = confuse(m9); | 429 x9 = confuse(m9); |
| 458 l9 = confuse(m9); | 430 l9 = confuse(m9); |
| 459 if (!tIsBool) { | 431 if (!tIsBool) { |
| 460 Expect.isTrue(f9 is F9<int>); | 432 Expect.isTrue(f9 is F9<int>); |
| 461 Expect.isFalse(f9 is F9<bool>); | 433 Expect.isFalse(f9 is F9<bool>); |
| 462 Expect.isTrue(confuse(f9) is F9<int>); | 434 Expect.isTrue(confuse(f9) is F9<int>); |
| 463 Expect.isFalse(confuse(f9) is F9<bool>); | 435 Expect.isFalse(confuse(f9) is F9<bool>); |
| 464 Expect.equals(tIsDynamic, m9 is F9<bool>); | 436 Expect.equals(tIsDynamic, m9 is F9<bool>); |
| 465 Expect.equals(tIsDynamic, confuse(m9) is F9<bool>); | 437 Expect.equals(tIsDynamic, confuse(m9) is F9<bool>); |
| 466 } else { | 438 } else { |
| 467 if (inCheckedMode) { | 439 if (typeAssertionsEnabled) { |
| 468 Expect.throws(() { | 440 Expect.throws(() { |
| 469 x9 = (f9 as dynamic); | 441 x9 = (f9 as dynamic); |
| 470 }); | 442 }); |
| 471 Expect.throws(() { | 443 Expect.throws(() { |
| 472 x9 = confuse(f9); | 444 x9 = confuse(f9); |
| 473 }); | 445 }); |
| 474 Function Function(int y, {List<T> x}) Function(int x) l9; | 446 Function Function(int y, {List<T> x}) Function(int x) l9; |
| 475 Expect.throws(() { | 447 Expect.throws(() { |
| 476 l9 = (f9 as dynamic); | 448 l9 = (f9 as dynamic); |
| 477 }); | 449 }); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 x11 = confuse(m11); | 506 x11 = confuse(m11); |
| 535 l11 = confuse(m11); | 507 l11 = confuse(m11); |
| 536 if (!tIsBool) { | 508 if (!tIsBool) { |
| 537 Expect.isTrue(f11 is F11<int>); | 509 Expect.isTrue(f11 is F11<int>); |
| 538 Expect.isFalse(f11 is F11<bool>); | 510 Expect.isFalse(f11 is F11<bool>); |
| 539 Expect.isTrue(confuse(f11) is F11<int>); | 511 Expect.isTrue(confuse(f11) is F11<int>); |
| 540 Expect.isFalse(confuse(f11) is F11<bool>); | 512 Expect.isFalse(confuse(f11) is F11<bool>); |
| 541 Expect.equals(tIsDynamic, m11 is F11<bool>); | 513 Expect.equals(tIsDynamic, m11 is F11<bool>); |
| 542 Expect.equals(tIsDynamic, confuse(m11) is F11<bool>); | 514 Expect.equals(tIsDynamic, confuse(m11) is F11<bool>); |
| 543 } else { | 515 } else { |
| 544 if (inCheckedMode) { | 516 if (typeAssertionsEnabled) { |
| 545 Expect.throws(() { | 517 Expect.throws(() { |
| 546 x11 = (f11 as dynamic); | 518 x11 = (f11 as dynamic); |
| 547 }); | 519 }); |
| 548 Expect.throws(() { | 520 Expect.throws(() { |
| 549 x11 = confuse(f11); | 521 x11 = confuse(f11); |
| 550 }); | 522 }); |
| 551 List<Function> Function(List<T> x1) Function(int x) l11; | 523 List<Function> Function(List<T> x1) Function(int x) l11; |
| 552 Expect.throws(() { | 524 Expect.throws(() { |
| 553 l11 = (f11 as dynamic); | 525 l11 = (f11 as dynamic); |
| 554 }); | 526 }); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 571 core.List<core.int> Function(int x2, [Function x3]) Function(int x) l12; | 543 core.List<core.int> Function(int x2, [Function x3]) Function(int x) l12; |
| 572 // The static function f12 sets `T` to `int`. | 544 // The static function f12 sets `T` to `int`. |
| 573 if (!tIsBool) { | 545 if (!tIsBool) { |
| 574 x12 = f12 as dynamic; | 546 x12 = f12 as dynamic; |
| 575 l12 = f12 as dynamic; | 547 l12 = f12 as dynamic; |
| 576 x12 = confuse(f12); | 548 x12 = confuse(f12); |
| 577 l12 = confuse(f12); | 549 l12 = confuse(f12); |
| 578 } | 550 } |
| 579 | 551 |
| 580 Expect.isTrue(m12 is F12); | 552 Expect.isTrue(m12 is F12); |
| 581 Expect.isTrue(m12 is core.List<core.int> Function(int x2, | 553 Expect.isTrue(m12 is core.List<core.int> Function(int x2, [Function x3]) |
| 582 [Function x3]) Function(int x)); | 554 Function(int x)); |
| 583 Expect.isTrue(confuse(m12) is F12); | 555 Expect.isTrue(confuse(m12) is F12); |
| 584 // In checked mode, verifies the type. | 556 // In checked mode, verifies the type. |
| 585 x12 = m12; | 557 x12 = m12; |
| 586 l12 = m12; | 558 l12 = m12; |
| 587 x12 = confuse(m12); | 559 x12 = confuse(m12); |
| 588 l12 = confuse(m12); | 560 l12 = confuse(m12); |
| 589 } | 561 } |
| 590 | 562 |
| 591 /// core.List<core.int> Function(int x1, {core.List<core.int> x}) Function(int
x) | 563 /// core.List<core.int> Function(int x1, {core.List<core.int> x}) Function(int
x) |
| 592 void testF13() { | 564 void testF13() { |
| 593 Expect.isTrue(f13 is F13); | 565 Expect.isTrue(f13 is F13); |
| 594 Expect.isTrue(confuse(f13) is F13); | 566 Expect.isTrue(confuse(f13) is F13); |
| 595 // In checked mode, verifies the type. | 567 // In checked mode, verifies the type. |
| 596 core.List<core.int> Function(int x1, {core.List<core.int> x}) Function( | 568 core.List<core.int> Function(int x1, {core.List<core.int> x}) Function( |
| 597 int x) l13; | 569 int x) l13; |
| 598 // The static function f13 sets `T` to `int`. | 570 // The static function f13 sets `T` to `int`. |
| 599 if (!tIsBool) { | 571 if (!tIsBool) { |
| 600 x13 = f13 as dynamic; | 572 x13 = f13 as dynamic; |
| 601 l13 = f13 as dynamic; | 573 l13 = f13 as dynamic; |
| 602 x13 = confuse(f13); | 574 x13 = confuse(f13); |
| 603 l13 = confuse(f13); | 575 l13 = confuse(f13); |
| 604 } | 576 } |
| 605 | 577 |
| 606 Expect.isTrue(m13 is F13); | 578 Expect.isTrue(m13 is F13); |
| 607 Expect.isTrue(m13 is core.List<core.int> Function(int x1, | 579 Expect.isTrue(m13 is core.List<core.int> Function(int x1, |
| 608 {core.List<core.int> x}) Function(int x)); | 580 {core.List<core.int> x}) |
| 581 Function(int x)); |
| 609 Expect.isTrue(confuse(m13) is F13); | 582 Expect.isTrue(confuse(m13) is F13); |
| 610 // In checked mode, verifies the type. | 583 // In checked mode, verifies the type. |
| 611 x13 = m13; | 584 x13 = m13; |
| 612 l13 = m13; | 585 l13 = m13; |
| 613 x13 = confuse(m13); | 586 x13 = confuse(m13); |
| 614 l13 = confuse(m13); | 587 l13 = confuse(m13); |
| 615 } | 588 } |
| 616 | 589 |
| 617 /// List<T> Function(Function x) Function(int x) | 590 /// List<T> Function(Function x) Function(int x) |
| 618 void testF14() { | 591 void testF14() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 637 x14 = confuse(m14); | 610 x14 = confuse(m14); |
| 638 l14 = confuse(m14); | 611 l14 = confuse(m14); |
| 639 if (!tIsBool) { | 612 if (!tIsBool) { |
| 640 Expect.isTrue(f14 is F14<int>); | 613 Expect.isTrue(f14 is F14<int>); |
| 641 Expect.isFalse(f14 is F14<bool>); | 614 Expect.isFalse(f14 is F14<bool>); |
| 642 Expect.isTrue(confuse(f14) is F14<int>); | 615 Expect.isTrue(confuse(f14) is F14<int>); |
| 643 Expect.isFalse(confuse(f14) is F14<bool>); | 616 Expect.isFalse(confuse(f14) is F14<bool>); |
| 644 Expect.equals(tIsDynamic, m14 is F14<bool>); | 617 Expect.equals(tIsDynamic, m14 is F14<bool>); |
| 645 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); | 618 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); |
| 646 } else { | 619 } else { |
| 647 if (inCheckedMode) { | 620 if (typeAssertionsEnabled) { |
| 648 Expect.throws(() { | 621 Expect.throws(() { |
| 649 x14 = (f14 as dynamic); | 622 x14 = (f14 as dynamic); |
| 650 }); | 623 }); |
| 651 Expect.throws(() { | 624 Expect.throws(() { |
| 652 x14 = confuse(f14); | 625 x14 = confuse(f14); |
| 653 }); | 626 }); |
| 654 List<T> Function(Function x) Function(int x) l14; | 627 List<T> Function(Function x) Function(int x) l14; |
| 655 Expect.throws(() { | 628 Expect.throws(() { |
| 656 l14 = (f14 as dynamic); | 629 l14 = (f14 as dynamic); |
| 657 }); | 630 }); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 674 List<T> Function(int y, [core.List<core.int> x]) Function(int x) l15; | 647 List<T> Function(int y, [core.List<core.int> x]) Function(int x) l15; |
| 675 // The static function f15 sets `T` to `int`. | 648 // The static function f15 sets `T` to `int`. |
| 676 if (!tIsBool) { | 649 if (!tIsBool) { |
| 677 x15 = f15 as dynamic; | 650 x15 = f15 as dynamic; |
| 678 l15 = f15 as dynamic; | 651 l15 = f15 as dynamic; |
| 679 x15 = confuse(f15); | 652 x15 = confuse(f15); |
| 680 l15 = confuse(f15); | 653 l15 = confuse(f15); |
| 681 } | 654 } |
| 682 | 655 |
| 683 Expect.isTrue(m15 is F15); | 656 Expect.isTrue(m15 is F15); |
| 684 Expect.isTrue(m15 is List<T> Function(int y, | 657 Expect.isTrue(m15 is List<T> Function(int y, [core.List<core.int> x]) |
| 685 [core.List<core.int> x]) Function(int x)); | 658 Function(int x)); |
| 686 Expect.isTrue(confuse(m15) is F15); | 659 Expect.isTrue(confuse(m15) is F15); |
| 687 // In checked mode, verifies the type. | 660 // In checked mode, verifies the type. |
| 688 x15 = m15; | 661 x15 = m15; |
| 689 l15 = m15; | 662 l15 = m15; |
| 690 x15 = confuse(m15); | 663 x15 = confuse(m15); |
| 691 l15 = confuse(m15); | 664 l15 = confuse(m15); |
| 692 if (!tIsBool) { | 665 if (!tIsBool) { |
| 693 Expect.isTrue(f15 is F15<int>); | 666 Expect.isTrue(f15 is F15<int>); |
| 694 Expect.isFalse(f15 is F15<bool>); | 667 Expect.isFalse(f15 is F15<bool>); |
| 695 Expect.isTrue(confuse(f15) is F15<int>); | 668 Expect.isTrue(confuse(f15) is F15<int>); |
| 696 Expect.isFalse(confuse(f15) is F15<bool>); | 669 Expect.isFalse(confuse(f15) is F15<bool>); |
| 697 Expect.equals(tIsDynamic, m15 is F15<bool>); | 670 Expect.equals(tIsDynamic, m15 is F15<bool>); |
| 698 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); | 671 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); |
| 699 } else { | 672 } else { |
| 700 if (inCheckedMode) { | 673 if (typeAssertionsEnabled) { |
| 701 Expect.throws(() { | 674 Expect.throws(() { |
| 702 x15 = (f15 as dynamic); | 675 x15 = (f15 as dynamic); |
| 703 }); | 676 }); |
| 704 Expect.throws(() { | 677 Expect.throws(() { |
| 705 x15 = confuse(f15); | 678 x15 = confuse(f15); |
| 706 }); | 679 }); |
| 707 List<T> Function(int y, [core.List<core.int> x]) Function(int x) l15; | 680 List<T> Function(int y, [core.List<core.int> x]) Function(int x) l15; |
| 708 Expect.throws(() { | 681 Expect.throws(() { |
| 709 l15 = (f15 as dynamic); | 682 l15 = (f15 as dynamic); |
| 710 }); | 683 }); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 x20 = confuse(m20); | 813 x20 = confuse(m20); |
| 841 l20 = confuse(m20); | 814 l20 = confuse(m20); |
| 842 if (!tIsBool) { | 815 if (!tIsBool) { |
| 843 Expect.isTrue(f20 is F20<int>); | 816 Expect.isTrue(f20 is F20<int>); |
| 844 Expect.isFalse(f20 is F20<bool>); | 817 Expect.isFalse(f20 is F20<bool>); |
| 845 Expect.isTrue(confuse(f20) is F20<int>); | 818 Expect.isTrue(confuse(f20) is F20<int>); |
| 846 Expect.isFalse(confuse(f20) is F20<bool>); | 819 Expect.isFalse(confuse(f20) is F20<bool>); |
| 847 Expect.equals(tIsDynamic, m20 is F20<bool>); | 820 Expect.equals(tIsDynamic, m20 is F20<bool>); |
| 848 Expect.equals(tIsDynamic, confuse(m20) is F20<bool>); | 821 Expect.equals(tIsDynamic, confuse(m20) is F20<bool>); |
| 849 } else { | 822 } else { |
| 850 if (inCheckedMode) { | 823 if (typeAssertionsEnabled) { |
| 851 Expect.throws(() { | 824 Expect.throws(() { |
| 852 x20 = (f20 as dynamic); | 825 x20 = (f20 as dynamic); |
| 853 }); | 826 }); |
| 854 Expect.throws(() { | 827 Expect.throws(() { |
| 855 x20 = confuse(f20); | 828 x20 = confuse(f20); |
| 856 }); | 829 }); |
| 857 void Function([List<T> x1]) Function(int x) l20; | 830 void Function([List<T> x1]) Function(int x) l20; |
| 858 Expect.throws(() { | 831 Expect.throws(() { |
| 859 l20 = (f20 as dynamic); | 832 l20 = (f20 as dynamic); |
| 860 }); | 833 }); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 x23 = confuse(m23); | 914 x23 = confuse(m23); |
| 942 l23 = confuse(m23); | 915 l23 = confuse(m23); |
| 943 if (!tIsBool) { | 916 if (!tIsBool) { |
| 944 Expect.isTrue(f23 is F23<int>); | 917 Expect.isTrue(f23 is F23<int>); |
| 945 Expect.isFalse(f23 is F23<bool>); | 918 Expect.isFalse(f23 is F23<bool>); |
| 946 Expect.isTrue(confuse(f23) is F23<int>); | 919 Expect.isTrue(confuse(f23) is F23<int>); |
| 947 Expect.isFalse(confuse(f23) is F23<bool>); | 920 Expect.isFalse(confuse(f23) is F23<bool>); |
| 948 Expect.equals(tIsDynamic, m23 is F23<bool>); | 921 Expect.equals(tIsDynamic, m23 is F23<bool>); |
| 949 Expect.equals(tIsDynamic, confuse(m23) is F23<bool>); | 922 Expect.equals(tIsDynamic, confuse(m23) is F23<bool>); |
| 950 } else { | 923 } else { |
| 951 if (inCheckedMode) { | 924 if (typeAssertionsEnabled) { |
| 952 Expect.throws(() { | 925 Expect.throws(() { |
| 953 x23 = (f23 as dynamic); | 926 x23 = (f23 as dynamic); |
| 954 }); | 927 }); |
| 955 Expect.throws(() { | 928 Expect.throws(() { |
| 956 x23 = confuse(f23); | 929 x23 = confuse(f23); |
| 957 }); | 930 }); |
| 958 void Function<A>(List<T> x) Function(int x) l23; | 931 void Function<A>(List<T> x) Function(int x) l23; |
| 959 Expect.throws(() { | 932 Expect.throws(() { |
| 960 l23 = (f23 as dynamic); | 933 l23 = (f23 as dynamic); |
| 961 }); | 934 }); |
| 962 Expect.throws(() { | 935 Expect.throws(() { |
| 963 l23 = confuse(f23); | 936 l23 = confuse(f23); |
| 964 }); | 937 }); |
| 965 } | 938 } |
| 966 void Function<A>(List<T> x) Function(int x) l23 = m23; | 939 void Function<A>(List<T> x) Function(int x) l23 = m23; |
| 967 // In checked mode, verifies the type. | 940 // In checked mode, verifies the type. |
| 968 x23 = m23; | 941 x23 = m23; |
| 969 x23 = confuse(m23); | 942 x23 = confuse(m23); |
| 970 } | 943 } |
| 971 } | 944 } |
| 972 } | 945 } |
| 973 | 946 |
| 974 void main() { | 947 void main() { |
| 975 new U5().runTests(); | 948 new U5().runTests(); |
| 976 new U5<int>(tIsInt: true).runTests(); | 949 new U5<int>(tIsInt: true).runTests(); |
| 977 new U5<bool>(tIsBool: true).runTests(); | 950 new U5<bool>(tIsBool: true).runTests(); |
| 978 } | 951 } |
| OLD | NEW |