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

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

Powered by Google App Engine
This is Rietveld 408576698