Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: tests/language/function_type/function_type29_test.dart

Issue 2879153005: Add support to dart2js for option --enable-asserts. (Closed)
Patch Set: Added !$checked to section predicate in co19 status file Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 x, [List<Function> x2]);
23 bool result = false; 23 typedef F1<T> = List<Function> Function(int x1, [Function x2]);
24 assert(result = true); 24 typedef F2<T> = List<T> Function([int x1]);
25 return result; 25 typedef F3<T> = Function([List<T> x1]);
26 })(); 26 typedef F4<T> = List<T> Function<A>();
27 27 typedef F5<T> = int Function([Function x1]) Function(int x);
28 typedef F0<T> 28 typedef F6<T> = int Function({core.List<core.int> x}) Function(int x);
29 = int Function(int x, [List<Function> x2]); 29 typedef F7<T> = Function Function(int y, {int x}) Function(int x);
30 typedef F1<T> 30 typedef F8<T> = Function Function(int x1, [core.List<core.int> x]) Function(
31 = List<Function> Function(int x1, [Function x2]); 31 int x);
32 typedef F2<T> 32 typedef F9<T> = List<Function> Function(int x1) Function(int x);
33 = List<T> Function([int x1]); 33 typedef F10<T> = List<Function> Function(int x, [List<Function> x1]) Function(
34 typedef F3<T> 34 int x);
35 = Function([List<T> x1]); 35 typedef F11<T> = List<Function> Function(int y, {List<T> x}) Function(int x);
36 typedef F4<T> 36 typedef F12<T> = core.List<core.int> Function([List<Function> x]) Function(
37 = List<T> Function<A>(); 37 int x);
38 typedef F5<T> 38 typedef F13<T> = core.List<core.int> Function(List<T> x1) Function(int x);
39 = int Function([Function x1]) Function(int x); 39 typedef F14<T> = List<T> Function(int x2, [Function x3]) Function(int x);
40 typedef F6<T> 40 typedef F15<T> = List<T> Function(int x1, {core.List<core.int> x}) Function(
41 = int Function({core.List<core.int> x}) Function(int x); 41 int x);
42 typedef F7<T> 42 typedef F16<T> = Function(Function x) Function(int x);
43 = Function Function(int y, {int x}) Function(int x); 43 typedef F17<T> = Function(int y, [core.List<core.int> x]) Function(int x);
44 typedef F8<T> 44 typedef F18<T> = void Function([int x1]) Function(int x);
45 = Function Function(int x1, [core.List<core.int> x]) Function(int x); 45 typedef F19<T> = void Function({List<Function> x}) Function(int x);
46 typedef F9<T> 46 typedef F20<T> = void Function() Function(int x);
47 = List<Function> Function(int x1) Function(int x); 47 typedef F21<T> = core.List<core.int> Function<A>(int x) Function(int x);
48 typedef F10<T> 48 typedef F22<T> = A Function<A>(Function x) Function(int x);
49 = List<Function> Function(int x, [List<Function> x1]) Function(int x); 49 typedef F23<T> = List<T> Function(B x) Function<B extends core.int>(int x);
50 typedef F11<T>
51 = List<Function> Function(int y, {List<T> x}) Function(int x);
52 typedef F12<T>
53 = core.List<core.int> Function([List<Function> x]) Function(int x);
54 typedef F13<T>
55 = core.List<core.int> Function(List<T> x1) Function(int x);
56 typedef F14<T>
57 = List<T> Function(int x2, [Function x3]) Function(int x);
58 typedef F15<T>
59 = List<T> Function(int x1, {core.List<core.int> x}) Function(int x);
60 typedef F16<T>
61 = Function(Function x) Function(int x);
62 typedef F17<T>
63 = Function(int y, [core.List<core.int> x]) Function(int x);
64 typedef F18<T>
65 = void Function([int x1]) Function(int x);
66 typedef F19<T>
67 = void Function({List<Function> x}) Function(int x);
68 typedef F20<T>
69 = void Function() Function(int x);
70 typedef F21<T>
71 = core.List<core.int> Function<A>(int x) Function(int x);
72 typedef F22<T>
73 = A Function<A>(Function x) Function(int x);
74 typedef F23<T>
75 = List<T> Function(B x) Function<B extends core.int>(int x);
76 50
77 int f0(int x, [List<Function> x0]) => null; 51 int f0(int x, [List<Function> x0]) => null;
78 List<Function> f1(int x0, [Function x1]) => null; 52 List<Function> f1(int x0, [Function x1]) => null;
79 List<int> f2([int x0]) => null; 53 List<int> f2([int x0]) => null;
80 f3([List<int> x0]) => null; 54 f3([List<int> x0]) => null;
81 List<int> f4<A>() => null; 55 List<int> f4<A>() => null;
82 int Function([Function x0]) f5(int x) => null; 56 int Function([Function x0]) f5(int x) => null;
83 int Function({core.List<core.int> x}) f6(int x) => null; 57 int Function({core.List<core.int> x}) f6(int x) => null;
84 Function Function(int y, {int x}) f7(int x) => null; 58 Function Function(int y, {int x}) f7(int x) => null;
85 Function Function(int x0, [core.List<core.int> x]) f8(int x) => null; 59 Function Function(int x0, [core.List<core.int> x]) f8(int x) => null;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 x2 = confuse(m2); 229 x2 = confuse(m2);
256 l2 = confuse(m2); 230 l2 = confuse(m2);
257 if (!tIsBool) { 231 if (!tIsBool) {
258 Expect.isTrue(f2 is F2<int>); 232 Expect.isTrue(f2 is F2<int>);
259 Expect.isFalse(f2 is F2<bool>); 233 Expect.isFalse(f2 is F2<bool>);
260 Expect.isTrue(confuse(f2) is F2<int>); 234 Expect.isTrue(confuse(f2) is F2<int>);
261 Expect.isFalse(confuse(f2) is F2<bool>); 235 Expect.isFalse(confuse(f2) is F2<bool>);
262 Expect.equals(tIsDynamic, m2 is F2<bool>); 236 Expect.equals(tIsDynamic, m2 is F2<bool>);
263 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); 237 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>);
264 } else { 238 } else {
265 if (inCheckedMode) { 239 if (typeAssertionsEnabled) {
266 Expect.throws(() { 240 Expect.throws(() {
267 x2 = (f2 as dynamic); 241 x2 = (f2 as dynamic);
268 }); 242 });
269 Expect.throws(() { 243 Expect.throws(() {
270 x2 = confuse(f2); 244 x2 = confuse(f2);
271 }); 245 });
272 List<T> Function([int x1]) l2; 246 List<T> Function([int x1]) l2;
273 Expect.throws(() { 247 Expect.throws(() {
274 l2 = (f2 as dynamic); 248 l2 = (f2 as dynamic);
275 }); 249 });
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 x3 = confuse(m3); 281 x3 = confuse(m3);
308 l3 = confuse(m3); 282 l3 = confuse(m3);
309 if (!tIsBool) { 283 if (!tIsBool) {
310 Expect.isTrue(f3 is F3<int>); 284 Expect.isTrue(f3 is F3<int>);
311 Expect.isFalse(f3 is F3<bool>); 285 Expect.isFalse(f3 is F3<bool>);
312 Expect.isTrue(confuse(f3) is F3<int>); 286 Expect.isTrue(confuse(f3) is F3<int>);
313 Expect.isFalse(confuse(f3) is F3<bool>); 287 Expect.isFalse(confuse(f3) is F3<bool>);
314 Expect.equals(tIsDynamic, m3 is F3<bool>); 288 Expect.equals(tIsDynamic, m3 is F3<bool>);
315 Expect.equals(tIsDynamic, confuse(m3) is F3<bool>); 289 Expect.equals(tIsDynamic, confuse(m3) is F3<bool>);
316 } else { 290 } else {
317 if (inCheckedMode) { 291 if (typeAssertionsEnabled) {
318 Expect.throws(() { 292 Expect.throws(() {
319 x3 = (f3 as dynamic); 293 x3 = (f3 as dynamic);
320 }); 294 });
321 Expect.throws(() { 295 Expect.throws(() {
322 x3 = confuse(f3); 296 x3 = confuse(f3);
323 }); 297 });
324 Function([List<T> x1]) l3; 298 Function([List<T> x1]) l3;
325 Expect.throws(() { 299 Expect.throws(() {
326 l3 = (f3 as dynamic); 300 l3 = (f3 as dynamic);
327 }); 301 });
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 x4 = confuse(m4); 333 x4 = confuse(m4);
360 l4 = confuse(m4); 334 l4 = confuse(m4);
361 if (!tIsBool) { 335 if (!tIsBool) {
362 Expect.isTrue(f4 is F4<int>); 336 Expect.isTrue(f4 is F4<int>);
363 Expect.isFalse(f4 is F4<bool>); 337 Expect.isFalse(f4 is F4<bool>);
364 Expect.isTrue(confuse(f4) is F4<int>); 338 Expect.isTrue(confuse(f4) is F4<int>);
365 Expect.isFalse(confuse(f4) is F4<bool>); 339 Expect.isFalse(confuse(f4) is F4<bool>);
366 Expect.equals(tIsDynamic, m4 is F4<bool>); 340 Expect.equals(tIsDynamic, m4 is F4<bool>);
367 Expect.equals(tIsDynamic, confuse(m4) is F4<bool>); 341 Expect.equals(tIsDynamic, confuse(m4) is F4<bool>);
368 } else { 342 } else {
369 if (inCheckedMode) { 343 if (typeAssertionsEnabled) {
370 Expect.throws(() { 344 Expect.throws(() {
371 x4 = (f4 as dynamic); 345 x4 = (f4 as dynamic);
372 }); 346 });
373 Expect.throws(() { 347 Expect.throws(() {
374 x4 = confuse(f4); 348 x4 = confuse(f4);
375 }); 349 });
376 List<T> Function<A>() l4; 350 List<T> Function<A>() l4;
377 Expect.throws(() { 351 Expect.throws(() {
378 l4 = (f4 as dynamic); 352 l4 = (f4 as dynamic);
379 }); 353 });
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 Function Function(int x1, [core.List<core.int> x]) Function(int x) l8; 442 Function Function(int x1, [core.List<core.int> x]) Function(int x) l8;
469 // The static function f8 sets `T` to `int`. 443 // The static function f8 sets `T` to `int`.
470 if (!tIsBool) { 444 if (!tIsBool) {
471 x8 = f8 as dynamic; 445 x8 = f8 as dynamic;
472 l8 = f8 as dynamic; 446 l8 = f8 as dynamic;
473 x8 = confuse(f8); 447 x8 = confuse(f8);
474 l8 = confuse(f8); 448 l8 = confuse(f8);
475 } 449 }
476 450
477 Expect.isTrue(m8 is F8); 451 Expect.isTrue(m8 is F8);
478 Expect.isTrue(m8 is Function Function(int x1, 452 Expect.isTrue(m8 is Function Function(int x1, [core.List<core.int> x])
479 [core.List<core.int> x]) Function(int x)); 453 Function(int x));
480 Expect.isTrue(confuse(m8) is F8); 454 Expect.isTrue(confuse(m8) is F8);
481 // In checked mode, verifies the type. 455 // In checked mode, verifies the type.
482 x8 = m8; 456 x8 = m8;
483 l8 = m8; 457 l8 = m8;
484 x8 = confuse(m8); 458 x8 = confuse(m8);
485 l8 = confuse(m8); 459 l8 = confuse(m8);
486 } 460 }
487 461
488 /// List<Function> Function(int x1) Function(int x) 462 /// List<Function> Function(int x1) Function(int x)
489 void testF9() { 463 void testF9() {
(...skipping 27 matching lines...) Expand all
517 List<Function> Function(int x, [List<Function> x1]) Function(int x) l10; 491 List<Function> Function(int x, [List<Function> x1]) Function(int x) l10;
518 // The static function f10 sets `T` to `int`. 492 // The static function f10 sets `T` to `int`.
519 if (!tIsBool) { 493 if (!tIsBool) {
520 x10 = f10 as dynamic; 494 x10 = f10 as dynamic;
521 l10 = f10 as dynamic; 495 l10 = f10 as dynamic;
522 x10 = confuse(f10); 496 x10 = confuse(f10);
523 l10 = confuse(f10); 497 l10 = confuse(f10);
524 } 498 }
525 499
526 Expect.isTrue(m10 is F10); 500 Expect.isTrue(m10 is F10);
527 Expect.isTrue(m10 is List<Function> Function(int x, 501 Expect.isTrue(m10 is List<Function> Function(int x, [List<Function> x1])
528 [List<Function> x1]) Function(int x)); 502 Function(int x));
529 Expect.isTrue(confuse(m10) is F10); 503 Expect.isTrue(confuse(m10) is F10);
530 // In checked mode, verifies the type. 504 // In checked mode, verifies the type.
531 x10 = m10; 505 x10 = m10;
532 l10 = m10; 506 l10 = m10;
533 x10 = confuse(m10); 507 x10 = confuse(m10);
534 l10 = confuse(m10); 508 l10 = confuse(m10);
535 } 509 }
536 510
537 /// List<Function> Function(int y, {List<T> x}) Function(int x) 511 /// List<Function> Function(int y, {List<T> x}) Function(int x)
538 void testF11() { 512 void testF11() {
(...skipping 19 matching lines...) Expand all
558 x11 = confuse(m11); 532 x11 = confuse(m11);
559 l11 = confuse(m11); 533 l11 = confuse(m11);
560 if (!tIsBool) { 534 if (!tIsBool) {
561 Expect.isTrue(f11 is F11<int>); 535 Expect.isTrue(f11 is F11<int>);
562 Expect.isFalse(f11 is F11<bool>); 536 Expect.isFalse(f11 is F11<bool>);
563 Expect.isTrue(confuse(f11) is F11<int>); 537 Expect.isTrue(confuse(f11) is F11<int>);
564 Expect.isFalse(confuse(f11) is F11<bool>); 538 Expect.isFalse(confuse(f11) is F11<bool>);
565 Expect.equals(tIsDynamic, m11 is F11<bool>); 539 Expect.equals(tIsDynamic, m11 is F11<bool>);
566 Expect.equals(tIsDynamic, confuse(m11) is F11<bool>); 540 Expect.equals(tIsDynamic, confuse(m11) is F11<bool>);
567 } else { 541 } else {
568 if (inCheckedMode) { 542 if (typeAssertionsEnabled) {
569 Expect.throws(() { 543 Expect.throws(() {
570 x11 = (f11 as dynamic); 544 x11 = (f11 as dynamic);
571 }); 545 });
572 Expect.throws(() { 546 Expect.throws(() {
573 x11 = confuse(f11); 547 x11 = confuse(f11);
574 }); 548 });
575 List<Function> Function(int y, {List<T> x}) Function(int x) l11; 549 List<Function> Function(int y, {List<T> x}) Function(int x) l11;
576 Expect.throws(() { 550 Expect.throws(() {
577 l11 = (f11 as dynamic); 551 l11 = (f11 as dynamic);
578 }); 552 });
(...skipping 16 matching lines...) Expand all
595 core.List<core.int> Function([List<Function> x]) Function(int x) l12; 569 core.List<core.int> Function([List<Function> x]) Function(int x) l12;
596 // The static function f12 sets `T` to `int`. 570 // The static function f12 sets `T` to `int`.
597 if (!tIsBool) { 571 if (!tIsBool) {
598 x12 = f12 as dynamic; 572 x12 = f12 as dynamic;
599 l12 = f12 as dynamic; 573 l12 = f12 as dynamic;
600 x12 = confuse(f12); 574 x12 = confuse(f12);
601 l12 = confuse(f12); 575 l12 = confuse(f12);
602 } 576 }
603 577
604 Expect.isTrue(m12 is F12); 578 Expect.isTrue(m12 is F12);
605 Expect.isTrue(m12 is core.List<core.int> Function( 579 Expect.isTrue(m12 is core.List<core.int> Function([List<Function> x])
606 [List<Function> x]) Function(int x)); 580 Function(int x));
607 Expect.isTrue(confuse(m12) is F12); 581 Expect.isTrue(confuse(m12) is F12);
608 // In checked mode, verifies the type. 582 // In checked mode, verifies the type.
609 x12 = m12; 583 x12 = m12;
610 l12 = m12; 584 l12 = m12;
611 x12 = confuse(m12); 585 x12 = confuse(m12);
612 l12 = confuse(m12); 586 l12 = confuse(m12);
613 } 587 }
614 588
615 /// core.List<core.int> Function(List<T> x1) Function(int x) 589 /// core.List<core.int> Function(List<T> x1) Function(int x)
616 void testF13() { 590 void testF13() {
(...skipping 19 matching lines...) Expand all
636 x13 = confuse(m13); 610 x13 = confuse(m13);
637 l13 = confuse(m13); 611 l13 = confuse(m13);
638 if (!tIsBool) { 612 if (!tIsBool) {
639 Expect.isTrue(f13 is F13<int>); 613 Expect.isTrue(f13 is F13<int>);
640 Expect.isFalse(f13 is F13<bool>); 614 Expect.isFalse(f13 is F13<bool>);
641 Expect.isTrue(confuse(f13) is F13<int>); 615 Expect.isTrue(confuse(f13) is F13<int>);
642 Expect.isFalse(confuse(f13) is F13<bool>); 616 Expect.isFalse(confuse(f13) is F13<bool>);
643 Expect.equals(tIsDynamic, m13 is F13<bool>); 617 Expect.equals(tIsDynamic, m13 is F13<bool>);
644 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); 618 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>);
645 } else { 619 } else {
646 if (inCheckedMode) { 620 if (typeAssertionsEnabled) {
647 Expect.throws(() { 621 Expect.throws(() {
648 x13 = (f13 as dynamic); 622 x13 = (f13 as dynamic);
649 }); 623 });
650 Expect.throws(() { 624 Expect.throws(() {
651 x13 = confuse(f13); 625 x13 = confuse(f13);
652 }); 626 });
653 core.List<core.int> Function(List<T> x1) Function(int x) l13; 627 core.List<core.int> Function(List<T> x1) Function(int x) l13;
654 Expect.throws(() { 628 Expect.throws(() {
655 l13 = (f13 as dynamic); 629 l13 = (f13 as dynamic);
656 }); 630 });
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 x14 = confuse(m14); 663 x14 = confuse(m14);
690 l14 = confuse(m14); 664 l14 = confuse(m14);
691 if (!tIsBool) { 665 if (!tIsBool) {
692 Expect.isTrue(f14 is F14<int>); 666 Expect.isTrue(f14 is F14<int>);
693 Expect.isFalse(f14 is F14<bool>); 667 Expect.isFalse(f14 is F14<bool>);
694 Expect.isTrue(confuse(f14) is F14<int>); 668 Expect.isTrue(confuse(f14) is F14<int>);
695 Expect.isFalse(confuse(f14) is F14<bool>); 669 Expect.isFalse(confuse(f14) is F14<bool>);
696 Expect.equals(tIsDynamic, m14 is F14<bool>); 670 Expect.equals(tIsDynamic, m14 is F14<bool>);
697 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); 671 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>);
698 } else { 672 } else {
699 if (inCheckedMode) { 673 if (typeAssertionsEnabled) {
700 Expect.throws(() { 674 Expect.throws(() {
701 x14 = (f14 as dynamic); 675 x14 = (f14 as dynamic);
702 }); 676 });
703 Expect.throws(() { 677 Expect.throws(() {
704 x14 = confuse(f14); 678 x14 = confuse(f14);
705 }); 679 });
706 List<T> Function(int x2, [Function x3]) Function(int x) l14; 680 List<T> Function(int x2, [Function x3]) Function(int x) l14;
707 Expect.throws(() { 681 Expect.throws(() {
708 l14 = (f14 as dynamic); 682 l14 = (f14 as dynamic);
709 }); 683 });
(...skipping 16 matching lines...) Expand all
726 List<T> Function(int x1, {core.List<core.int> x}) Function(int x) l15; 700 List<T> Function(int x1, {core.List<core.int> x}) Function(int x) l15;
727 // The static function f15 sets `T` to `int`. 701 // The static function f15 sets `T` to `int`.
728 if (!tIsBool) { 702 if (!tIsBool) {
729 x15 = f15 as dynamic; 703 x15 = f15 as dynamic;
730 l15 = f15 as dynamic; 704 l15 = f15 as dynamic;
731 x15 = confuse(f15); 705 x15 = confuse(f15);
732 l15 = confuse(f15); 706 l15 = confuse(f15);
733 } 707 }
734 708
735 Expect.isTrue(m15 is F15); 709 Expect.isTrue(m15 is F15);
736 Expect.isTrue(m15 is List<T> Function(int x1, 710 Expect.isTrue(m15 is List<T> Function(int x1, {core.List<core.int> x})
737 {core.List<core.int> x}) Function(int x)); 711 Function(int x));
738 Expect.isTrue(confuse(m15) is F15); 712 Expect.isTrue(confuse(m15) is F15);
739 // In checked mode, verifies the type. 713 // In checked mode, verifies the type.
740 x15 = m15; 714 x15 = m15;
741 l15 = m15; 715 l15 = m15;
742 x15 = confuse(m15); 716 x15 = confuse(m15);
743 l15 = confuse(m15); 717 l15 = confuse(m15);
744 if (!tIsBool) { 718 if (!tIsBool) {
745 Expect.isTrue(f15 is F15<int>); 719 Expect.isTrue(f15 is F15<int>);
746 Expect.isFalse(f15 is F15<bool>); 720 Expect.isFalse(f15 is F15<bool>);
747 Expect.isTrue(confuse(f15) is F15<int>); 721 Expect.isTrue(confuse(f15) is F15<int>);
748 Expect.isFalse(confuse(f15) is F15<bool>); 722 Expect.isFalse(confuse(f15) is F15<bool>);
749 Expect.equals(tIsDynamic, m15 is F15<bool>); 723 Expect.equals(tIsDynamic, m15 is F15<bool>);
750 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); 724 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>);
751 } else { 725 } else {
752 if (inCheckedMode) { 726 if (typeAssertionsEnabled) {
753 Expect.throws(() { 727 Expect.throws(() {
754 x15 = (f15 as dynamic); 728 x15 = (f15 as dynamic);
755 }); 729 });
756 Expect.throws(() { 730 Expect.throws(() {
757 x15 = confuse(f15); 731 x15 = confuse(f15);
758 }); 732 });
759 List<T> Function(int x1, {core.List<core.int> x}) Function(int x) l15; 733 List<T> Function(int x1, {core.List<core.int> x}) Function(int x) l15;
760 Expect.throws(() { 734 Expect.throws(() {
761 l15 = (f15 as dynamic); 735 l15 = (f15 as dynamic);
762 }); 736 });
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 x23 = confuse(m23); 940 x23 = confuse(m23);
967 l23 = confuse(m23); 941 l23 = confuse(m23);
968 if (!tIsBool) { 942 if (!tIsBool) {
969 Expect.isTrue(f23 is F23<int>); 943 Expect.isTrue(f23 is F23<int>);
970 Expect.isFalse(f23 is F23<bool>); 944 Expect.isFalse(f23 is F23<bool>);
971 Expect.isTrue(confuse(f23) is F23<int>); 945 Expect.isTrue(confuse(f23) is F23<int>);
972 Expect.isFalse(confuse(f23) is F23<bool>); 946 Expect.isFalse(confuse(f23) is F23<bool>);
973 Expect.equals(tIsDynamic, m23 is F23<bool>); 947 Expect.equals(tIsDynamic, m23 is F23<bool>);
974 Expect.equals(tIsDynamic, confuse(m23) is F23<bool>); 948 Expect.equals(tIsDynamic, confuse(m23) is F23<bool>);
975 } else { 949 } else {
976 if (inCheckedMode) { 950 if (typeAssertionsEnabled) {
977 Expect.throws(() { 951 Expect.throws(() {
978 x23 = (f23 as dynamic); 952 x23 = (f23 as dynamic);
979 }); 953 });
980 Expect.throws(() { 954 Expect.throws(() {
981 x23 = confuse(f23); 955 x23 = confuse(f23);
982 }); 956 });
983 List<T> Function(B x) Function<B extends core.int>(int x) l23; 957 List<T> Function(B x) Function<B extends core.int>(int x) l23;
984 Expect.throws(() { 958 Expect.throws(() {
985 l23 = (f23 as dynamic); 959 l23 = (f23 as dynamic);
986 }); 960 });
987 Expect.throws(() { 961 Expect.throws(() {
988 l23 = confuse(f23); 962 l23 = confuse(f23);
989 }); 963 });
990 } 964 }
991 List<T> Function(B x) Function<B extends core.int>(int x) l23 = m23; 965 List<T> Function(B x) Function<B extends core.int>(int x) l23 = m23;
992 // In checked mode, verifies the type. 966 // In checked mode, verifies the type.
993 x23 = m23; 967 x23 = m23;
994 x23 = confuse(m23); 968 x23 = confuse(m23);
995 } 969 }
996 } 970 }
997 } 971 }
998 972
999 void main() { 973 void main() {
1000 new U29().runTests(); 974 new U29().runTests();
1001 new U29<int>(tIsInt: true).runTests(); 975 new U29<int>(tIsInt: true).runTests();
1002 new U29<bool>(tIsBool: true).runTests(); 976 new U29<bool>(tIsBool: true).runTests();
1003 } 977 }
OLDNEW
« no previous file with comments | « tests/language/function_type/function_type28_test.dart ('k') | tests/language/function_type/function_type2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698