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

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

Powered by Google App Engine
This is Rietveld 408576698