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

Side by Side Diff: tests/language/function_type/function_type94_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> = Function Function([core.List<core.int> x1]);
23 bool result = false; 23 typedef F1<T> = core.List<core.int> Function(List<Function> x0);
24 assert(result = true); 24 typedef F2<T> = Function(int y, [Function x]);
25 return result; 25 typedef F3<T> = int Function<A>(List<Function> x);
26 })(); 26 typedef F4<T> = int Function(int x, [int x1]) Function<B extends core.int>();
27 27 typedef F5<T> = int Function(int y, {List<Function> x})
28 typedef F0<T> 28 Function<B extends core.int>();
29 = Function Function([core.List<core.int> x1]); 29 typedef F6<T> = Function Function([int x]) Function<B extends core.int>();
30 typedef F1<T> 30 typedef F7<T> = Function Function(List<Function> x1)
31 = core.List<core.int> Function(List<Function> x0); 31 Function<B extends core.int>();
32 typedef F2<T> 32 typedef F8<T> = Function Function(int x, [List<T> x1])
33 = Function(int y, [Function x]); 33 Function<B extends core.int>();
34 typedef F3<T> 34 typedef F9<T> = List<Function> Function(int x1, {Function x})
35 = int Function<A>(List<Function> x); 35 Function<B extends core.int>();
36 typedef F4<T> 36 typedef F10<T> = List<Function> Function([List<T> x])
37 = int Function(int x, [int x1]) Function<B extends core.int>(); 37 Function<B extends core.int>();
38 typedef F5<T> 38 typedef F11<T> = core.List<core.int> Function(int y, [Function x])
39 = int Function(int y, {List<Function> x}) Function<B extends core.int>(); 39 Function<B extends core.int>();
40 typedef F6<T> 40 typedef F12<T> = core.List<core.int> Function(int x2, [core.List<core.int> x3])
41 = Function Function([int x]) Function<B extends core.int>(); 41 Function<B extends core.int>();
42 typedef F7<T> 42 typedef F13<T> = List<T> Function({int x}) Function<B extends core.int>();
43 = Function Function(List<Function> x1) Function<B extends core.int>(); 43 typedef F14<T> = List<T> Function(core.List<core.int> x)
44 typedef F8<T> 44 Function<B extends core.int>();
45 = Function Function(int x, [List<T> x1]) Function<B extends core.int>(); 45 typedef F15<T> = Function(int x1, [int x]) Function<B extends core.int>();
46 typedef F9<T> 46 typedef F16<T> = Function([List<Function> x1]) Function<B extends core.int>();
47 = List<Function> Function(int x1, 47 typedef F17<T> = Function({List<T> x}) Function<B extends core.int>();
48 {Function x}) Function<B extends core.int>(); 48 typedef F18<T> = void Function(int y, {Function x})
49 typedef F10<T> 49 Function<B extends core.int>();
50 = List<Function> Function([List<T> x]) Function<B extends core.int>(); 50 typedef F19<T> = void Function(int x1, [List<T> x])
51 typedef F11<T> 51 Function<B extends core.int>();
52 = core.List<core.int> Function(int y, 52 typedef F20<T> = Function Function<A>(List<A> x) Function<B extends core.int>();
53 [Function x]) Function<B extends core.int>(); 53 typedef F21<T> = Function<A>(int x) Function<B extends core.int>();
54 typedef F12<T> 54 typedef F22<T> = void Function<A>(Function x) Function<B extends core.int>();
55 = core.List<core.int> Function(int x2,
56 [core.List<core.int> x3]) Function<B extends core.int>();
57 typedef F13<T>
58 = List<T> Function({int x}) Function<B extends core.int>();
59 typedef F14<T>
60 = List<T> Function(core.List<core.int> x) Function<B extends core.int>();
61 typedef F15<T>
62 = Function(int x1, [int x]) Function<B extends core.int>();
63 typedef F16<T>
64 = Function([List<Function> x1]) Function<B extends core.int>();
65 typedef F17<T>
66 = Function({List<T> x}) Function<B extends core.int>();
67 typedef F18<T>
68 = void Function(int y, {Function x}) Function<B extends core.int>();
69 typedef F19<T>
70 = void Function(int x1, [List<T> x]) Function<B extends core.int>();
71 typedef F20<T>
72 = Function Function<A>(List<A> x) Function<B extends core.int>();
73 typedef F21<T>
74 = Function<A>(int x) Function<B extends core.int>();
75 typedef F22<T>
76 = void Function<A>(Function x) Function<B extends core.int>();
77 55
78 Function f0([core.List<core.int> x0]) => null; 56 Function f0([core.List<core.int> x0]) => null;
79 core.List<core.int> f1(List<Function> x0) => null; 57 core.List<core.int> f1(List<Function> x0) => null;
80 f2(int y, [Function x]) => null; 58 f2(int y, [Function x]) => null;
81 int f3<A>(List<Function> x) => null; 59 int f3<A>(List<Function> x) => null;
82 int Function(int x, [int x0]) f4<B extends core.int>() => null; 60 int Function(int x, [int x0]) f4<B extends core.int>() => null;
83 int Function(int y, {List<Function> x}) f5<B extends core.int>() => null; 61 int Function(int y, {List<Function> x}) f5<B extends core.int>() => null;
84 Function Function([int x]) f6<B extends core.int>() => null; 62 Function Function([int x]) f6<B extends core.int>() => null;
85 Function Function(List<Function> x0) f7<B extends core.int>() => null; 63 Function Function(List<Function> x0) f7<B extends core.int>() => null;
86 Function Function(int x, [List<int> x0]) f8<B extends core.int>() => null; 64 Function Function(int x, [List<int> x0]) f8<B extends core.int>() => null;
(...skipping 24 matching lines...) Expand all
111 Function(int y, [Function x]) x2; 89 Function(int y, [Function x]) x2;
112 int Function<A>(List<Function> x) x3; 90 int Function<A>(List<Function> x) x3;
113 int Function(int x, [int x1]) Function<B extends core.int>() x4; 91 int Function(int x, [int x1]) Function<B extends core.int>() x4;
114 int Function(int y, {List<Function> x}) Function<B extends core.int>() x5; 92 int Function(int y, {List<Function> x}) Function<B extends core.int>() x5;
115 Function Function([int x]) Function<B extends core.int>() x6; 93 Function Function([int x]) Function<B extends core.int>() x6;
116 Function Function(List<Function> x1) Function<B extends core.int>() x7; 94 Function Function(List<Function> x1) Function<B extends core.int>() x7;
117 Function Function(int x, [List<T> x1]) Function<B extends core.int>() x8; 95 Function Function(int x, [List<T> x1]) Function<B extends core.int>() x8;
118 List<Function> Function(int x1, {Function x}) Function<B extends core.int>() 96 List<Function> Function(int x1, {Function x}) Function<B extends core.int>()
119 x9; 97 x9;
120 List<Function> Function([List<T> x]) Function<B extends core.int>() x10; 98 List<Function> Function([List<T> x]) Function<B extends core.int>() x10;
121 core.List<core.int> Function(int y, 99 core.List<core.int> Function(int y, [Function x])
122 [Function x]) Function<B extends core.int>() x11; 100 Function<B extends core.int>() x11;
123 core.List<core.int> Function(int x2, 101 core.List<core.int> Function(int x2, [core.List<core.int> x3])
124 [core.List<core.int> x3]) Function<B extends core.int>() x12; 102 Function<B extends core.int>() x12;
125 List<T> Function({int x}) Function<B extends core.int>() x13; 103 List<T> Function({int x}) Function<B extends core.int>() x13;
126 List<T> Function(core.List<core.int> x) Function<B extends core.int>() x14; 104 List<T> Function(core.List<core.int> x) Function<B extends core.int>() x14;
127 Function(int x1, [int x]) Function<B extends core.int>() x15; 105 Function(int x1, [int x]) Function<B extends core.int>() x15;
128 Function([List<Function> x1]) Function<B extends core.int>() x16; 106 Function([List<Function> x1]) Function<B extends core.int>() x16;
129 Function({List<T> x}) Function<B extends core.int>() x17; 107 Function({List<T> x}) Function<B extends core.int>() x17;
130 void Function(int y, {Function x}) Function<B extends core.int>() x18; 108 void Function(int y, {Function x}) Function<B extends core.int>() x18;
131 void Function(int x1, [List<T> x]) Function<B extends core.int>() x19; 109 void Function(int x1, [List<T> x]) Function<B extends core.int>() x19;
132 Function Function<A>(List<A> x) Function<B extends core.int>() x20; 110 Function Function<A>(List<A> x) Function<B extends core.int>() x20;
133 Function<A>(int x) Function<B extends core.int>() x21; 111 Function<A>(int x) Function<B extends core.int>() x21;
134 void Function<A>(Function x) Function<B extends core.int>() x22; 112 void Function<A>(Function x) Function<B extends core.int>() x22;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 int Function(int y, {List<Function> x}) Function<B extends core.int>() l5; 296 int Function(int y, {List<Function> x}) Function<B extends core.int>() l5;
319 // The static function f5 sets `T` to `int`. 297 // The static function f5 sets `T` to `int`.
320 if (!tIsBool) { 298 if (!tIsBool) {
321 x5 = f5 as dynamic; 299 x5 = f5 as dynamic;
322 l5 = f5 as dynamic; 300 l5 = f5 as dynamic;
323 x5 = confuse(f5); 301 x5 = confuse(f5);
324 l5 = confuse(f5); 302 l5 = confuse(f5);
325 } 303 }
326 304
327 Expect.isTrue(m5 is F5); 305 Expect.isTrue(m5 is F5);
328 Expect.isTrue(m5 is int Function(int y, 306 Expect.isTrue(m5 is int Function(int y, {List<Function> x})
329 {List<Function> x}) Function<B extends core.int>()); 307 Function<B extends core.int>());
330 Expect.isTrue(confuse(m5) is F5); 308 Expect.isTrue(confuse(m5) is F5);
331 // In checked mode, verifies the type. 309 // In checked mode, verifies the type.
332 x5 = m5; 310 x5 = m5;
333 l5 = m5; 311 l5 = m5;
334 x5 = confuse(m5); 312 x5 = confuse(m5);
335 l5 = confuse(m5); 313 l5 = confuse(m5);
336 } 314 }
337 315
338 /// Function Function([int x]) Function<B extends core.int>() 316 /// Function Function([int x]) Function<B extends core.int>()
339 void testF6() { 317 void testF6() {
(...skipping 28 matching lines...) Expand all
368 Function Function(List<Function> x1) Function<B extends core.int>() l7; 346 Function Function(List<Function> x1) Function<B extends core.int>() l7;
369 // The static function f7 sets `T` to `int`. 347 // The static function f7 sets `T` to `int`.
370 if (!tIsBool) { 348 if (!tIsBool) {
371 x7 = f7 as dynamic; 349 x7 = f7 as dynamic;
372 l7 = f7 as dynamic; 350 l7 = f7 as dynamic;
373 x7 = confuse(f7); 351 x7 = confuse(f7);
374 l7 = confuse(f7); 352 l7 = confuse(f7);
375 } 353 }
376 354
377 Expect.isTrue(m7 is F7); 355 Expect.isTrue(m7 is F7);
378 Expect.isTrue(m7 is Function Function( 356 Expect.isTrue(m7 is Function Function(List<Function> x1)
379 List<Function> x1) Function<B extends core.int>()); 357 Function<B extends core.int>());
380 Expect.isTrue(confuse(m7) is F7); 358 Expect.isTrue(confuse(m7) is F7);
381 // In checked mode, verifies the type. 359 // In checked mode, verifies the type.
382 x7 = m7; 360 x7 = m7;
383 l7 = m7; 361 l7 = m7;
384 x7 = confuse(m7); 362 x7 = confuse(m7);
385 l7 = confuse(m7); 363 l7 = confuse(m7);
386 } 364 }
387 365
388 /// Function Function(int x, [List<T> x1]) Function<B extends core.int>() 366 /// Function Function(int x, [List<T> x1]) Function<B extends core.int>()
389 void testF8() { 367 void testF8() {
390 Expect.isTrue(f8 is F8); 368 Expect.isTrue(f8 is F8);
391 Expect.isTrue(confuse(f8) is F8); 369 Expect.isTrue(confuse(f8) is F8);
392 // In checked mode, verifies the type. 370 // In checked mode, verifies the type.
393 Function Function(int x, [List<T> x1]) Function<B extends core.int>() l8; 371 Function Function(int x, [List<T> x1]) Function<B extends core.int>() l8;
394 // The static function f8 sets `T` to `int`. 372 // The static function f8 sets `T` to `int`.
395 if (!tIsBool) { 373 if (!tIsBool) {
396 x8 = f8 as dynamic; 374 x8 = f8 as dynamic;
397 l8 = f8 as dynamic; 375 l8 = f8 as dynamic;
398 x8 = confuse(f8); 376 x8 = confuse(f8);
399 l8 = confuse(f8); 377 l8 = confuse(f8);
400 } 378 }
401 379
402 Expect.isTrue(m8 is F8); 380 Expect.isTrue(m8 is F8);
403 Expect.isTrue(m8 is Function Function(int x, 381 Expect.isTrue(m8 is Function Function(int x, [List<T> x1])
404 [List<T> x1]) Function<B extends core.int>()); 382 Function<B extends core.int>());
405 Expect.isTrue(confuse(m8) is F8); 383 Expect.isTrue(confuse(m8) is F8);
406 // In checked mode, verifies the type. 384 // In checked mode, verifies the type.
407 x8 = m8; 385 x8 = m8;
408 l8 = m8; 386 l8 = m8;
409 x8 = confuse(m8); 387 x8 = confuse(m8);
410 l8 = confuse(m8); 388 l8 = confuse(m8);
411 if (!tIsBool) { 389 if (!tIsBool) {
412 Expect.isTrue(f8 is F8<int>); 390 Expect.isTrue(f8 is F8<int>);
413 Expect.isFalse(f8 is F8<bool>); 391 Expect.isFalse(f8 is F8<bool>);
414 Expect.isTrue(confuse(f8) is F8<int>); 392 Expect.isTrue(confuse(f8) is F8<int>);
415 Expect.isFalse(confuse(f8) is F8<bool>); 393 Expect.isFalse(confuse(f8) is F8<bool>);
416 Expect.equals(tIsDynamic, m8 is F8<bool>); 394 Expect.equals(tIsDynamic, m8 is F8<bool>);
417 Expect.equals(tIsDynamic, confuse(m8) is F8<bool>); 395 Expect.equals(tIsDynamic, confuse(m8) is F8<bool>);
418 } else { 396 } else {
419 if (inCheckedMode) { 397 if (typeAssertionsEnabled) {
420 Expect.throws(() { 398 Expect.throws(() {
421 x8 = (f8 as dynamic); 399 x8 = (f8 as dynamic);
422 }); 400 });
423 Expect.throws(() { 401 Expect.throws(() {
424 x8 = confuse(f8); 402 x8 = confuse(f8);
425 }); 403 });
426 Function Function(int x, [List<T> x1]) Function<B extends core.int>() 404 Function Function(int x, [List<T> x1]) Function<B extends core.int>()
427 l8; 405 l8;
428 Expect.throws(() { 406 Expect.throws(() {
429 l8 = (f8 as dynamic); 407 l8 = (f8 as dynamic);
(...skipping 19 matching lines...) Expand all
449 l9; 427 l9;
450 // The static function f9 sets `T` to `int`. 428 // The static function f9 sets `T` to `int`.
451 if (!tIsBool) { 429 if (!tIsBool) {
452 x9 = f9 as dynamic; 430 x9 = f9 as dynamic;
453 l9 = f9 as dynamic; 431 l9 = f9 as dynamic;
454 x9 = confuse(f9); 432 x9 = confuse(f9);
455 l9 = confuse(f9); 433 l9 = confuse(f9);
456 } 434 }
457 435
458 Expect.isTrue(m9 is F9); 436 Expect.isTrue(m9 is F9);
459 Expect.isTrue(m9 is List<Function> Function(int x1, 437 Expect.isTrue(m9 is List<Function> Function(int x1, {Function x})
460 {Function x}) Function<B extends core.int>()); 438 Function<B extends core.int>());
461 Expect.isTrue(confuse(m9) is F9); 439 Expect.isTrue(confuse(m9) is F9);
462 // In checked mode, verifies the type. 440 // In checked mode, verifies the type.
463 x9 = m9; 441 x9 = m9;
464 l9 = m9; 442 l9 = m9;
465 x9 = confuse(m9); 443 x9 = confuse(m9);
466 l9 = confuse(m9); 444 l9 = confuse(m9);
467 } 445 }
468 446
469 /// List<Function> Function([List<T> x]) Function<B extends core.int>() 447 /// List<Function> Function([List<T> x]) Function<B extends core.int>()
470 void testF10() { 448 void testF10() {
471 Expect.isTrue(f10 is F10); 449 Expect.isTrue(f10 is F10);
472 Expect.isTrue(confuse(f10) is F10); 450 Expect.isTrue(confuse(f10) is F10);
473 // In checked mode, verifies the type. 451 // In checked mode, verifies the type.
474 List<Function> Function([List<T> x]) Function<B extends core.int>() l10; 452 List<Function> Function([List<T> x]) Function<B extends core.int>() l10;
475 // The static function f10 sets `T` to `int`. 453 // The static function f10 sets `T` to `int`.
476 if (!tIsBool) { 454 if (!tIsBool) {
477 x10 = f10 as dynamic; 455 x10 = f10 as dynamic;
478 l10 = f10 as dynamic; 456 l10 = f10 as dynamic;
479 x10 = confuse(f10); 457 x10 = confuse(f10);
480 l10 = confuse(f10); 458 l10 = confuse(f10);
481 } 459 }
482 460
483 Expect.isTrue(m10 is F10); 461 Expect.isTrue(m10 is F10);
484 Expect.isTrue(m10 is List<Function> Function( 462 Expect.isTrue(m10 is List<Function> Function([List<T> x])
485 [List<T> x]) Function<B extends core.int>()); 463 Function<B extends core.int>());
486 Expect.isTrue(confuse(m10) is F10); 464 Expect.isTrue(confuse(m10) is F10);
487 // In checked mode, verifies the type. 465 // In checked mode, verifies the type.
488 x10 = m10; 466 x10 = m10;
489 l10 = m10; 467 l10 = m10;
490 x10 = confuse(m10); 468 x10 = confuse(m10);
491 l10 = confuse(m10); 469 l10 = confuse(m10);
492 if (!tIsBool) { 470 if (!tIsBool) {
493 Expect.isTrue(f10 is F10<int>); 471 Expect.isTrue(f10 is F10<int>);
494 Expect.isFalse(f10 is F10<bool>); 472 Expect.isFalse(f10 is F10<bool>);
495 Expect.isTrue(confuse(f10) is F10<int>); 473 Expect.isTrue(confuse(f10) is F10<int>);
496 Expect.isFalse(confuse(f10) is F10<bool>); 474 Expect.isFalse(confuse(f10) is F10<bool>);
497 Expect.equals(tIsDynamic, m10 is F10<bool>); 475 Expect.equals(tIsDynamic, m10 is F10<bool>);
498 Expect.equals(tIsDynamic, confuse(m10) is F10<bool>); 476 Expect.equals(tIsDynamic, confuse(m10) is F10<bool>);
499 } else { 477 } else {
500 if (inCheckedMode) { 478 if (typeAssertionsEnabled) {
501 Expect.throws(() { 479 Expect.throws(() {
502 x10 = (f10 as dynamic); 480 x10 = (f10 as dynamic);
503 }); 481 });
504 Expect.throws(() { 482 Expect.throws(() {
505 x10 = confuse(f10); 483 x10 = confuse(f10);
506 }); 484 });
507 List<Function> Function([List<T> x]) Function<B extends core.int>() l10; 485 List<Function> Function([List<T> x]) Function<B extends core.int>() l10;
508 Expect.throws(() { 486 Expect.throws(() {
509 l10 = (f10 as dynamic); 487 l10 = (f10 as dynamic);
510 }); 488 });
511 Expect.throws(() { 489 Expect.throws(() {
512 l10 = confuse(f10); 490 l10 = confuse(f10);
513 }); 491 });
514 } 492 }
515 List<Function> Function([List<T> x]) Function<B extends core.int>() l10 = 493 List<Function> Function([List<T> x]) Function<B extends core.int>() l10 =
516 m10; 494 m10;
517 // In checked mode, verifies the type. 495 // In checked mode, verifies the type.
518 x10 = m10; 496 x10 = m10;
519 x10 = confuse(m10); 497 x10 = confuse(m10);
520 } 498 }
521 } 499 }
522 500
523 /// core.List<core.int> Function(int y, [Function x]) Function<B extends core. int>() 501 /// core.List<core.int> Function(int y, [Function x]) Function<B extends core. int>()
524 void testF11() { 502 void testF11() {
525 Expect.isTrue(f11 is F11); 503 Expect.isTrue(f11 is F11);
526 Expect.isTrue(confuse(f11) is F11); 504 Expect.isTrue(confuse(f11) is F11);
527 // In checked mode, verifies the type. 505 // In checked mode, verifies the type.
528 core.List<core.int> Function(int y, 506 core.List<core.int> Function(int y, [Function x])
529 [Function x]) Function<B extends core.int>() l11; 507 Function<B extends core.int>() l11;
530 // The static function f11 sets `T` to `int`. 508 // The static function f11 sets `T` to `int`.
531 if (!tIsBool) { 509 if (!tIsBool) {
532 x11 = f11 as dynamic; 510 x11 = f11 as dynamic;
533 l11 = f11 as dynamic; 511 l11 = f11 as dynamic;
534 x11 = confuse(f11); 512 x11 = confuse(f11);
535 l11 = confuse(f11); 513 l11 = confuse(f11);
536 } 514 }
537 515
538 Expect.isTrue(m11 is F11); 516 Expect.isTrue(m11 is F11);
539 Expect.isTrue(m11 is core.List<core.int> Function(int y, 517 Expect.isTrue(m11 is core.List<core.int> Function(int y, [Function x])
540 [Function x]) Function<B extends core.int>()); 518 Function<B extends core.int>());
541 Expect.isTrue(confuse(m11) is F11); 519 Expect.isTrue(confuse(m11) is F11);
542 // In checked mode, verifies the type. 520 // In checked mode, verifies the type.
543 x11 = m11; 521 x11 = m11;
544 l11 = m11; 522 l11 = m11;
545 x11 = confuse(m11); 523 x11 = confuse(m11);
546 l11 = confuse(m11); 524 l11 = confuse(m11);
547 } 525 }
548 526
549 /// core.List<core.int> Function(int x2, [core.List<core.int> x3]) Function<B extends core.int>() 527 /// core.List<core.int> Function(int x2, [core.List<core.int> x3]) Function<B extends core.int>()
550 void testF12() { 528 void testF12() {
551 Expect.isTrue(f12 is F12); 529 Expect.isTrue(f12 is F12);
552 Expect.isTrue(confuse(f12) is F12); 530 Expect.isTrue(confuse(f12) is F12);
553 // In checked mode, verifies the type. 531 // In checked mode, verifies the type.
554 core.List<core.int> Function(int x2, 532 core.List<core.int> Function(int x2, [core.List<core.int> x3])
555 [core.List<core.int> x3]) Function<B extends core.int>() l12; 533 Function<B extends core.int>() l12;
556 // The static function f12 sets `T` to `int`. 534 // The static function f12 sets `T` to `int`.
557 if (!tIsBool) { 535 if (!tIsBool) {
558 x12 = f12 as dynamic; 536 x12 = f12 as dynamic;
559 l12 = f12 as dynamic; 537 l12 = f12 as dynamic;
560 x12 = confuse(f12); 538 x12 = confuse(f12);
561 l12 = confuse(f12); 539 l12 = confuse(f12);
562 } 540 }
563 541
564 Expect.isTrue(m12 is F12); 542 Expect.isTrue(m12 is F12);
565 Expect.isTrue(m12 is core.List<core.int> Function(int x2, 543 Expect.isTrue(m12 is core.List<core.int> Function(int x2,
566 [core.List<core.int> x3]) Function<B extends core.int>()); 544 [core.List<core.int> x3])
545 Function<B extends core.int>());
567 Expect.isTrue(confuse(m12) is F12); 546 Expect.isTrue(confuse(m12) is F12);
568 // In checked mode, verifies the type. 547 // In checked mode, verifies the type.
569 x12 = m12; 548 x12 = m12;
570 l12 = m12; 549 l12 = m12;
571 x12 = confuse(m12); 550 x12 = confuse(m12);
572 l12 = confuse(m12); 551 l12 = confuse(m12);
573 } 552 }
574 553
575 /// List<T> Function({int x}) Function<B extends core.int>() 554 /// List<T> Function({int x}) Function<B extends core.int>()
576 void testF13() { 555 void testF13() {
(...skipping 19 matching lines...) Expand all
596 x13 = confuse(m13); 575 x13 = confuse(m13);
597 l13 = confuse(m13); 576 l13 = confuse(m13);
598 if (!tIsBool) { 577 if (!tIsBool) {
599 Expect.isTrue(f13 is F13<int>); 578 Expect.isTrue(f13 is F13<int>);
600 Expect.isFalse(f13 is F13<bool>); 579 Expect.isFalse(f13 is F13<bool>);
601 Expect.isTrue(confuse(f13) is F13<int>); 580 Expect.isTrue(confuse(f13) is F13<int>);
602 Expect.isFalse(confuse(f13) is F13<bool>); 581 Expect.isFalse(confuse(f13) is F13<bool>);
603 Expect.equals(tIsDynamic, m13 is F13<bool>); 582 Expect.equals(tIsDynamic, m13 is F13<bool>);
604 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); 583 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>);
605 } else { 584 } else {
606 if (inCheckedMode) { 585 if (typeAssertionsEnabled) {
607 Expect.throws(() { 586 Expect.throws(() {
608 x13 = (f13 as dynamic); 587 x13 = (f13 as dynamic);
609 }); 588 });
610 Expect.throws(() { 589 Expect.throws(() {
611 x13 = confuse(f13); 590 x13 = confuse(f13);
612 }); 591 });
613 List<T> Function({int x}) Function<B extends core.int>() l13; 592 List<T> Function({int x}) Function<B extends core.int>() l13;
614 Expect.throws(() { 593 Expect.throws(() {
615 l13 = (f13 as dynamic); 594 l13 = (f13 as dynamic);
616 }); 595 });
(...skipping 16 matching lines...) Expand all
633 List<T> Function(core.List<core.int> x) Function<B extends core.int>() l14; 612 List<T> Function(core.List<core.int> x) Function<B extends core.int>() l14;
634 // The static function f14 sets `T` to `int`. 613 // The static function f14 sets `T` to `int`.
635 if (!tIsBool) { 614 if (!tIsBool) {
636 x14 = f14 as dynamic; 615 x14 = f14 as dynamic;
637 l14 = f14 as dynamic; 616 l14 = f14 as dynamic;
638 x14 = confuse(f14); 617 x14 = confuse(f14);
639 l14 = confuse(f14); 618 l14 = confuse(f14);
640 } 619 }
641 620
642 Expect.isTrue(m14 is F14); 621 Expect.isTrue(m14 is F14);
643 Expect.isTrue(m14 is List<T> Function( 622 Expect.isTrue(m14 is List<T> Function(core.List<core.int> x)
644 core.List<core.int> x) Function<B extends core.int>()); 623 Function<B extends core.int>());
645 Expect.isTrue(confuse(m14) is F14); 624 Expect.isTrue(confuse(m14) is F14);
646 // In checked mode, verifies the type. 625 // In checked mode, verifies the type.
647 x14 = m14; 626 x14 = m14;
648 l14 = m14; 627 l14 = m14;
649 x14 = confuse(m14); 628 x14 = confuse(m14);
650 l14 = confuse(m14); 629 l14 = confuse(m14);
651 if (!tIsBool) { 630 if (!tIsBool) {
652 Expect.isTrue(f14 is F14<int>); 631 Expect.isTrue(f14 is F14<int>);
653 Expect.isFalse(f14 is F14<bool>); 632 Expect.isFalse(f14 is F14<bool>);
654 Expect.isTrue(confuse(f14) is F14<int>); 633 Expect.isTrue(confuse(f14) is F14<int>);
655 Expect.isFalse(confuse(f14) is F14<bool>); 634 Expect.isFalse(confuse(f14) is F14<bool>);
656 Expect.equals(tIsDynamic, m14 is F14<bool>); 635 Expect.equals(tIsDynamic, m14 is F14<bool>);
657 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); 636 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>);
658 } else { 637 } else {
659 if (inCheckedMode) { 638 if (typeAssertionsEnabled) {
660 Expect.throws(() { 639 Expect.throws(() {
661 x14 = (f14 as dynamic); 640 x14 = (f14 as dynamic);
662 }); 641 });
663 Expect.throws(() { 642 Expect.throws(() {
664 x14 = confuse(f14); 643 x14 = confuse(f14);
665 }); 644 });
666 List<T> Function(core.List<core.int> x) Function<B extends core.int>() 645 List<T> Function(core.List<core.int> x) Function<B extends core.int>()
667 l14; 646 l14;
668 Expect.throws(() { 647 Expect.throws(() {
669 l14 = (f14 as dynamic); 648 l14 = (f14 as dynamic);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 x17 = confuse(m17); 732 x17 = confuse(m17);
754 l17 = confuse(m17); 733 l17 = confuse(m17);
755 if (!tIsBool) { 734 if (!tIsBool) {
756 Expect.isTrue(f17 is F17<int>); 735 Expect.isTrue(f17 is F17<int>);
757 Expect.isFalse(f17 is F17<bool>); 736 Expect.isFalse(f17 is F17<bool>);
758 Expect.isTrue(confuse(f17) is F17<int>); 737 Expect.isTrue(confuse(f17) is F17<int>);
759 Expect.isFalse(confuse(f17) is F17<bool>); 738 Expect.isFalse(confuse(f17) is F17<bool>);
760 Expect.equals(tIsDynamic, m17 is F17<bool>); 739 Expect.equals(tIsDynamic, m17 is F17<bool>);
761 Expect.equals(tIsDynamic, confuse(m17) is F17<bool>); 740 Expect.equals(tIsDynamic, confuse(m17) is F17<bool>);
762 } else { 741 } else {
763 if (inCheckedMode) { 742 if (typeAssertionsEnabled) {
764 Expect.throws(() { 743 Expect.throws(() {
765 x17 = (f17 as dynamic); 744 x17 = (f17 as dynamic);
766 }); 745 });
767 Expect.throws(() { 746 Expect.throws(() {
768 x17 = confuse(f17); 747 x17 = confuse(f17);
769 }); 748 });
770 Function({List<T> x}) Function<B extends core.int>() l17; 749 Function({List<T> x}) Function<B extends core.int>() l17;
771 Expect.throws(() { 750 Expect.throws(() {
772 l17 = (f17 as dynamic); 751 l17 = (f17 as dynamic);
773 }); 752 });
(...skipping 16 matching lines...) Expand all
790 void Function(int y, {Function x}) Function<B extends core.int>() l18; 769 void Function(int y, {Function x}) Function<B extends core.int>() l18;
791 // The static function f18 sets `T` to `int`. 770 // The static function f18 sets `T` to `int`.
792 if (!tIsBool) { 771 if (!tIsBool) {
793 x18 = f18 as dynamic; 772 x18 = f18 as dynamic;
794 l18 = f18 as dynamic; 773 l18 = f18 as dynamic;
795 x18 = confuse(f18); 774 x18 = confuse(f18);
796 l18 = confuse(f18); 775 l18 = confuse(f18);
797 } 776 }
798 777
799 Expect.isTrue(m18 is F18); 778 Expect.isTrue(m18 is F18);
800 Expect.isTrue(m18 is void Function(int y, 779 Expect.isTrue(m18 is void Function(int y, {Function x})
801 {Function x}) Function<B extends core.int>()); 780 Function<B extends core.int>());
802 Expect.isTrue(confuse(m18) is F18); 781 Expect.isTrue(confuse(m18) is F18);
803 // In checked mode, verifies the type. 782 // In checked mode, verifies the type.
804 x18 = m18; 783 x18 = m18;
805 l18 = m18; 784 l18 = m18;
806 x18 = confuse(m18); 785 x18 = confuse(m18);
807 l18 = confuse(m18); 786 l18 = confuse(m18);
808 } 787 }
809 788
810 /// void Function(int x1, [List<T> x]) Function<B extends core.int>() 789 /// void Function(int x1, [List<T> x]) Function<B extends core.int>()
811 void testF19() { 790 void testF19() {
812 Expect.isTrue(f19 is F19); 791 Expect.isTrue(f19 is F19);
813 Expect.isTrue(confuse(f19) is F19); 792 Expect.isTrue(confuse(f19) is F19);
814 // In checked mode, verifies the type. 793 // In checked mode, verifies the type.
815 void Function(int x1, [List<T> x]) Function<B extends core.int>() l19; 794 void Function(int x1, [List<T> x]) Function<B extends core.int>() l19;
816 // The static function f19 sets `T` to `int`. 795 // The static function f19 sets `T` to `int`.
817 if (!tIsBool) { 796 if (!tIsBool) {
818 x19 = f19 as dynamic; 797 x19 = f19 as dynamic;
819 l19 = f19 as dynamic; 798 l19 = f19 as dynamic;
820 x19 = confuse(f19); 799 x19 = confuse(f19);
821 l19 = confuse(f19); 800 l19 = confuse(f19);
822 } 801 }
823 802
824 Expect.isTrue(m19 is F19); 803 Expect.isTrue(m19 is F19);
825 Expect.isTrue(m19 is void Function(int x1, 804 Expect.isTrue(m19 is void Function(int x1, [List<T> x])
826 [List<T> x]) Function<B extends core.int>()); 805 Function<B extends core.int>());
827 Expect.isTrue(confuse(m19) is F19); 806 Expect.isTrue(confuse(m19) is F19);
828 // In checked mode, verifies the type. 807 // In checked mode, verifies the type.
829 x19 = m19; 808 x19 = m19;
830 l19 = m19; 809 l19 = m19;
831 x19 = confuse(m19); 810 x19 = confuse(m19);
832 l19 = confuse(m19); 811 l19 = confuse(m19);
833 if (!tIsBool) { 812 if (!tIsBool) {
834 Expect.isTrue(f19 is F19<int>); 813 Expect.isTrue(f19 is F19<int>);
835 Expect.isFalse(f19 is F19<bool>); 814 Expect.isFalse(f19 is F19<bool>);
836 Expect.isTrue(confuse(f19) is F19<int>); 815 Expect.isTrue(confuse(f19) is F19<int>);
837 Expect.isFalse(confuse(f19) is F19<bool>); 816 Expect.isFalse(confuse(f19) is F19<bool>);
838 Expect.equals(tIsDynamic, m19 is F19<bool>); 817 Expect.equals(tIsDynamic, m19 is F19<bool>);
839 Expect.equals(tIsDynamic, confuse(m19) is F19<bool>); 818 Expect.equals(tIsDynamic, confuse(m19) is F19<bool>);
840 } else { 819 } else {
841 if (inCheckedMode) { 820 if (typeAssertionsEnabled) {
842 Expect.throws(() { 821 Expect.throws(() {
843 x19 = (f19 as dynamic); 822 x19 = (f19 as dynamic);
844 }); 823 });
845 Expect.throws(() { 824 Expect.throws(() {
846 x19 = confuse(f19); 825 x19 = confuse(f19);
847 }); 826 });
848 void Function(int x1, [List<T> x]) Function<B extends core.int>() l19; 827 void Function(int x1, [List<T> x]) Function<B extends core.int>() l19;
849 Expect.throws(() { 828 Expect.throws(() {
850 l19 = (f19 as dynamic); 829 l19 = (f19 as dynamic);
851 }); 830 });
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 x22 = confuse(m22); 913 x22 = confuse(m22);
935 l22 = confuse(m22); 914 l22 = confuse(m22);
936 } 915 }
937 } 916 }
938 917
939 void main() { 918 void main() {
940 new U94().runTests(); 919 new U94().runTests();
941 new U94<int>(tIsInt: true).runTests(); 920 new U94<int>(tIsInt: true).runTests();
942 new U94<bool>(tIsBool: true).runTests(); 921 new U94<bool>(tIsBool: true).runTests();
943 } 922 }
OLDNEW
« no previous file with comments | « tests/language/function_type/function_type93_test.dart ('k') | tests/language/function_type/function_type95_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698