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

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

Issue 2904563005: Reformat generated tests files. (Closed)
Patch Set: Created 3 years, 7 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 final bool inCheckedMode = (() {
23 (() { bool result = false; assert(result = true); return result; })(); 23 bool result = false;
24 assert(result = true);
25 return result;
26 })();
24 27
25 28 typedef F0<T>
26 typedef F0<T> = int Function({List<T> x}); 29 = int Function({List<T> x});
27 typedef F1<T> = List<Function> Function(int x, [core.List<core.int> x2]); 30 typedef F1<T>
28 typedef F2<T> = List<T> Function(int x1, [List<Function> x2]); 31 = List<Function> Function(int x, [core.List<core.int> x2]);
29 typedef F3<T> = void Function([Function x1]); 32 typedef F2<T>
30 typedef F4<T> = List<A> Function<A>(List<T> x); 33 = List<T> Function(int x1, [List<Function> x2]);
31 typedef F5<T> = int Function(List<Function> x) Function(); 34 typedef F3<T>
32 typedef F6<T> = int Function(int y, [List<T> x]) Function(); 35 = void Function([Function x1]);
33 typedef F7<T> = Function Function([Function x1]) Function(); 36 typedef F4<T>
34 typedef F8<T> = Function Function({core.List<core.int> x}) Function(); 37 = List<A> Function<A>(List<T> x);
35 typedef F9<T> = List<Function> Function(int y, {int x}) Function(); 38 typedef F5<T>
36 typedef F10<T> = List<Function> Function(int x0, [core.List<core.int> x]) Functi on(); 39 = int Function(List<Function> x) Function();
37 typedef F11<T> = core.List<core.int> Function(int x0) Function(); 40 typedef F6<T>
38 typedef F12<T> = core.List<core.int> Function(int x, [List<Function> x2]) Functi on(); 41 = int Function(int y, [List<T> x]) Function();
39 typedef F13<T> = core.List<core.int> Function(int y, {List<T> x}) Function(); 42 typedef F7<T>
40 typedef F14<T> = List<T> Function([List<Function> x]) Function(); 43 = Function Function([Function x1]) Function();
41 typedef F15<T> = List<T> Function(List<T> x0) Function(); 44 typedef F8<T>
42 typedef F16<T> = Function(int x1, [Function x2]) Function(); 45 = Function Function({core.List<core.int> x}) Function();
43 typedef F17<T> = Function(int x0, {core.List<core.int> x}) Function(); 46 typedef F9<T>
44 typedef F18<T> = void Function(Function x) Function(); 47 = List<Function> Function(int y, {int x}) Function();
45 typedef F19<T> = void Function(int y, [core.List<core.int> x]) Function(); 48 typedef F10<T>
46 typedef F20<T> = int Function<A>() Function(); 49 = List<Function> Function(int x0, [core.List<core.int> x]) Function();
47 typedef F21<T> = core.List<core.int> Function<A>(A x) Function(); 50 typedef F11<T>
48 typedef F22<T> = A Function<A>(List<A> x) Function(); 51 = core.List<core.int> Function(int x0) Function();
49 52 typedef F12<T>
53 = core.List<core.int> Function(int x, [List<Function> x2]) Function();
54 typedef F13<T>
55 = core.List<core.int> Function(int y, {List<T> x}) Function();
56 typedef F14<T>
57 = List<T> Function([List<Function> x]) Function();
58 typedef F15<T>
59 = List<T> Function(List<T> x0) Function();
60 typedef F16<T>
61 = Function(int x1, [Function x2]) Function();
62 typedef F17<T>
63 = Function(int x0, {core.List<core.int> x}) Function();
64 typedef F18<T>
65 = void Function(Function x) Function();
66 typedef F19<T>
67 = void Function(int y, [core.List<core.int> x]) Function();
68 typedef F20<T>
69 = int Function<A>() Function();
70 typedef F21<T>
71 = core.List<core.int> Function<A>(A x) Function();
72 typedef F22<T>
73 = A Function<A>(List<A> x) Function();
50 74
51 int f0({List<int> x}) => null; 75 int f0({List<int> x}) => null;
52 List<Function> f1(int x, [core.List<core.int> x0]) => null; 76 List<Function> f1(int x, [core.List<core.int> x0]) => null;
53 List<int> f2(int x0, [List<Function> x1]) => null; 77 List<int> f2(int x0, [List<Function> x1]) => null;
54 void f3([Function x0]) => null; 78 void f3([Function x0]) => null;
55 List<A> f4<A>(List<int> x) => null; 79 List<A> f4<A>(List<int> x) => null;
56 int Function(List<Function> x) f5() => null; 80 int Function(List<Function> x) f5() => null;
57 int Function(int y, [List<int> x]) f6() => null; 81 int Function(int y, [List<int> x]) f6() => null;
58 Function Function([Function x0]) f7() => null; 82 Function Function([Function x0]) f7() => null;
59 Function Function({core.List<core.int> x}) f8() => null; 83 Function Function({core.List<core.int> x}) f8() => null;
60 List<Function> Function(int y, {int x}) f9() => null; 84 List<Function> Function(int y, {int x}) f9() => null;
61 List<Function> Function(int x0, [core.List<core.int> x]) f10() => null; 85 List<Function> Function(int x0, [core.List<core.int> x]) f10() => null;
62 core.List<core.int> Function(int x0) f11() => null; 86 core.List<core.int> Function(int x0) f11() => null;
63 core.List<core.int> Function(int x, [List<Function> x0]) f12() => null; 87 core.List<core.int> Function(int x, [List<Function> x0]) f12() => null;
64 core.List<core.int> Function(int y, {List<int> x}) f13() => null; 88 core.List<core.int> Function(int y, {List<int> x}) f13() => null;
65 List<int> Function([List<Function> x]) f14() => null; 89 List<int> Function([List<Function> x]) f14() => null;
66 List<int> Function(List<int> x0) f15() => null; 90 List<int> Function(List<int> x0) f15() => null;
67 Function(int x0, [Function x1]) f16() => null; 91 Function(int x0, [Function x1]) f16() => null;
68 Function(int x0, {core.List<core.int> x}) f17() => null; 92 Function(int x0, {core.List<core.int> x}) f17() => null;
69 void Function(Function x) f18() => null; 93 void Function(Function x) f18() => null;
70 void Function(int y, [core.List<core.int> x]) f19() => null; 94 void Function(int y, [core.List<core.int> x]) f19() => null;
71 int Function<A>() f20() => null; 95 int Function<A>() f20() => null;
72 core.List<core.int> Function<A>(A x) f21() => null; 96 core.List<core.int> Function<A>(A x) f21() => null;
73 A Function<A>(List<A> x) f22() => null; 97 A Function<A>(List<A> x) f22() => null;
74 98
75
76 class U52<T> { 99 class U52<T> {
77 final bool tIsBool; 100 final bool tIsBool;
78 final bool tIsInt; 101 final bool tIsInt;
79 final bool tIsDynamic; 102 final bool tIsDynamic;
80 103
81 int Function({List<T> x}) x0; 104 int Function({List<T> x}) x0;
82 List<Function> Function(int x, [core.List<core.int> x2]) x1; 105 List<Function> Function(int x, [core.List<core.int> x2]) x1;
83 List<T> Function(int x1, [List<Function> x2]) x2; 106 List<T> Function(int x1, [List<Function> x2]) x2;
84 void Function([Function x1]) x3; 107 void Function([Function x1]) x3;
85 List<A> Function<A>(List<T> x) x4; 108 List<A> Function<A>(List<T> x) x4;
86 int Function(List<Function> x) Function() x5; 109 int Function(List<Function> x) Function() x5;
87 int Function(int y, [List<T> x]) Function() x6; 110 int Function(int y, [List<T> x]) Function() x6;
88 Function Function([Function x1]) Function() x7; 111 Function Function([Function x1]) Function() x7;
89 Function Function({core.List<core.int> x}) Function() x8; 112 Function Function({core.List<core.int> x}) Function() x8;
90 List<Function> Function(int y, {int x}) Function() x9; 113 List<Function> Function(int y, {int x}) Function() x9;
91 List<Function> Function(int x0, [core.List<core.int> x]) Function() x10; 114 List<Function> Function(int x0, [core.List<core.int> x]) Function() x10;
92 core.List<core.int> Function(int x0) Function() x11; 115 core.List<core.int> Function(int x0) Function() x11;
93 core.List<core.int> Function(int x, [List<Function> x2]) Function() x12; 116 core.List<core.int> Function(int x, [List<Function> x2]) Function() x12;
94 core.List<core.int> Function(int y, {List<T> x}) Function() x13; 117 core.List<core.int> Function(int y, {List<T> x}) Function() x13;
95 List<T> Function([List<Function> x]) Function() x14; 118 List<T> Function([List<Function> x]) Function() x14;
96 List<T> Function(List<T> x0) Function() x15; 119 List<T> Function(List<T> x0) Function() x15;
97 Function(int x1, [Function x2]) Function() x16; 120 Function(int x1, [Function x2]) Function() x16;
98 Function(int x0, {core.List<core.int> x}) Function() x17; 121 Function(int x0, {core.List<core.int> x}) Function() x17;
99 void Function(Function x) Function() x18; 122 void Function(Function x) Function() x18;
100 void Function(int y, [core.List<core.int> x]) Function() x19; 123 void Function(int y, [core.List<core.int> x]) Function() x19;
101 int Function<A>() Function() x20; 124 int Function<A>() Function() x20;
102 core.List<core.int> Function<A>(A x) Function() x21; 125 core.List<core.int> Function<A>(A x) Function() x21;
103 A Function<A>(List<A> x) Function() x22; 126 A Function<A>(List<A> x) Function() x22;
104 127
105
106 U52({this.tIsBool: false, this.tIsInt: false}) 128 U52({this.tIsBool: false, this.tIsInt: false})
107 : tIsDynamic = !tIsBool && !tIsInt; 129 : tIsDynamic = !tIsBool && !tIsInt;
108 130
109 int m0({List<T> x}) => null; 131 int m0({List<T> x}) => null;
110 List<Function> m1(int x, [core.List<core.int> x0]) => null; 132 List<Function> m1(int x, [core.List<core.int> x0]) => null;
111 List<T> m2(int x0, [List<Function> x1]) => null; 133 List<T> m2(int x0, [List<Function> x1]) => null;
112 void m3([Function x0]) => null; 134 void m3([Function x0]) => null;
113 List<A> m4<A>(List<T> x) => null; 135 List<A> m4<A>(List<T> x) => null;
114 int Function(List<Function> x) m5() => null; 136 int Function(List<Function> x) m5() => null;
115 int Function(int y, [List<T> x]) m6() => null; 137 int Function(int y, [List<T> x]) m6() => null;
116 Function Function([Function x0]) m7() => null; 138 Function Function([Function x0]) m7() => null;
117 Function Function({core.List<core.int> x}) m8() => null; 139 Function Function({core.List<core.int> x}) m8() => null;
118 List<Function> Function(int y, {int x}) m9() => null; 140 List<Function> Function(int y, {int x}) m9() => null;
119 List<Function> Function(int x0, [core.List<core.int> x]) m10() => null; 141 List<Function> Function(int x0, [core.List<core.int> x]) m10() => null;
120 core.List<core.int> Function(int x0) m11() => null; 142 core.List<core.int> Function(int x0) m11() => null;
121 core.List<core.int> Function(int x, [List<Function> x0]) m12() => null; 143 core.List<core.int> Function(int x, [List<Function> x0]) m12() => null;
122 core.List<core.int> Function(int y, {List<T> x}) m13() => null; 144 core.List<core.int> Function(int y, {List<T> x}) m13() => null;
123 List<T> Function([List<Function> x]) m14() => null; 145 List<T> Function([List<Function> x]) m14() => null;
124 List<T> Function(List<T> x0) m15() => null; 146 List<T> Function(List<T> x0) m15() => null;
125 Function(int x0, [Function x1]) m16() => null; 147 Function(int x0, [Function x1]) m16() => null;
126 Function(int x0, {core.List<core.int> x}) m17() => null; 148 Function(int x0, {core.List<core.int> x}) m17() => null;
127 void Function(Function x) m18() => null; 149 void Function(Function x) m18() => null;
128 void Function(int y, [core.List<core.int> x]) m19() => null; 150 void Function(int y, [core.List<core.int> x]) m19() => null;
129 int Function<A>() m20() => null; 151 int Function<A>() m20() => null;
130 core.List<core.int> Function<A>(A x) m21() => null; 152 core.List<core.int> Function<A>(A x) m21() => null;
131 A Function<A>(List<A> x) m22() => null; 153 A Function<A>(List<A> x) m22() => null;
132 154
133
134 runTests() { 155 runTests() {
135 testF0(); 156 testF0();
136 testF1(); 157 testF1();
137 testF2(); 158 testF2();
138 testF3(); 159 testF3();
139 testF4(); 160 testF4();
140 testF5(); 161 testF5();
141 testF6(); 162 testF6();
142 testF7(); 163 testF7();
143 testF8(); 164 testF8();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 l0 = confuse(m0); 202 l0 = confuse(m0);
182 if (!tIsBool) { 203 if (!tIsBool) {
183 Expect.isTrue(f0 is F0<int>); 204 Expect.isTrue(f0 is F0<int>);
184 Expect.isFalse(f0 is F0<bool>); 205 Expect.isFalse(f0 is F0<bool>);
185 Expect.isTrue(confuse(f0) is F0<int>); 206 Expect.isTrue(confuse(f0) is F0<int>);
186 Expect.isFalse(confuse(f0) is F0<bool>); 207 Expect.isFalse(confuse(f0) is F0<bool>);
187 Expect.equals(tIsDynamic, m0 is F0<bool>); 208 Expect.equals(tIsDynamic, m0 is F0<bool>);
188 Expect.equals(tIsDynamic, confuse(m0) is F0<bool>); 209 Expect.equals(tIsDynamic, confuse(m0) is F0<bool>);
189 } else { 210 } else {
190 if (inCheckedMode) { 211 if (inCheckedMode) {
191 Expect.throws(() { x0 = (f0 as dynamic); }); 212 Expect.throws(() {
192 Expect.throws(() { x0 = confuse(f0); }); 213 x0 = (f0 as dynamic);
214 });
215 Expect.throws(() {
216 x0 = confuse(f0);
217 });
193 int Function({List<T> x}) l0; 218 int Function({List<T> x}) l0;
194 Expect.throws(() { l0 = (f0 as dynamic); }); 219 Expect.throws(() {
195 Expect.throws(() { l0 = confuse(f0); }); 220 l0 = (f0 as dynamic);
221 });
222 Expect.throws(() {
223 l0 = confuse(f0);
224 });
196 } 225 }
197 int Function({List<T> x}) l0 = m0; 226 int Function({List<T> x}) l0 = m0;
198 // In checked mode, verifies the type. 227 // In checked mode, verifies the type.
199 x0 = m0; 228 x0 = m0;
200 x0 = confuse(m0); 229 x0 = confuse(m0);
201 } 230 }
202 } 231 }
203 232
204 /// List<Function> Function(int x, [core.List<core.int> x2]) 233 /// List<Function> Function(int x, [core.List<core.int> x2])
205 void testF1() { 234 void testF1() {
206 Expect.isTrue(f1 is F1); 235 Expect.isTrue(f1 is F1);
207 Expect.isTrue(confuse(f1) is F1); 236 Expect.isTrue(confuse(f1) is F1);
208 // In checked mode, verifies the type. 237 // In checked mode, verifies the type.
209 List<Function> Function(int x, [core.List<core.int> x2]) l1; 238 List<Function> Function(int x, [core.List<core.int> x2]) l1;
210 // The static function f1 sets `T` to `int`. 239 // The static function f1 sets `T` to `int`.
211 if (!tIsBool) { 240 if (!tIsBool) {
212 x1 = f1 as dynamic; 241 x1 = f1 as dynamic;
213 l1 = f1 as dynamic; 242 l1 = f1 as dynamic;
214 x1 = confuse(f1); 243 x1 = confuse(f1);
215 l1 = confuse(f1); 244 l1 = confuse(f1);
216 } 245 }
217 246
218 Expect.isTrue(m1 is F1); 247 Expect.isTrue(m1 is F1);
219 Expect.isTrue(m1 is List<Function> Function(int x, [core.List<core.int> x2]) ); 248 Expect
249 .isTrue(m1 is List<Function> Function(int x, [core.List<core.int> x2]));
220 Expect.isTrue(confuse(m1) is F1); 250 Expect.isTrue(confuse(m1) is F1);
221 // In checked mode, verifies the type. 251 // In checked mode, verifies the type.
222 x1 = m1; 252 x1 = m1;
223 l1 = m1; 253 l1 = m1;
224 x1 = confuse(m1); 254 x1 = confuse(m1);
225 l1 = confuse(m1); 255 l1 = confuse(m1);
226
227 } 256 }
228 257
229 /// List<T> Function(int x1, [List<Function> x2]) 258 /// List<T> Function(int x1, [List<Function> x2])
230 void testF2() { 259 void testF2() {
231 Expect.isTrue(f2 is F2); 260 Expect.isTrue(f2 is F2);
232 Expect.isTrue(confuse(f2) is F2); 261 Expect.isTrue(confuse(f2) is F2);
233 // In checked mode, verifies the type. 262 // In checked mode, verifies the type.
234 List<T> Function(int x1, [List<Function> x2]) l2; 263 List<T> Function(int x1, [List<Function> x2]) l2;
235 // The static function f2 sets `T` to `int`. 264 // The static function f2 sets `T` to `int`.
236 if (!tIsBool) { 265 if (!tIsBool) {
(...skipping 13 matching lines...) Expand all
250 l2 = confuse(m2); 279 l2 = confuse(m2);
251 if (!tIsBool) { 280 if (!tIsBool) {
252 Expect.isTrue(f2 is F2<int>); 281 Expect.isTrue(f2 is F2<int>);
253 Expect.isFalse(f2 is F2<bool>); 282 Expect.isFalse(f2 is F2<bool>);
254 Expect.isTrue(confuse(f2) is F2<int>); 283 Expect.isTrue(confuse(f2) is F2<int>);
255 Expect.isFalse(confuse(f2) is F2<bool>); 284 Expect.isFalse(confuse(f2) is F2<bool>);
256 Expect.equals(tIsDynamic, m2 is F2<bool>); 285 Expect.equals(tIsDynamic, m2 is F2<bool>);
257 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); 286 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>);
258 } else { 287 } else {
259 if (inCheckedMode) { 288 if (inCheckedMode) {
260 Expect.throws(() { x2 = (f2 as dynamic); }); 289 Expect.throws(() {
261 Expect.throws(() { x2 = confuse(f2); }); 290 x2 = (f2 as dynamic);
291 });
292 Expect.throws(() {
293 x2 = confuse(f2);
294 });
262 List<T> Function(int x1, [List<Function> x2]) l2; 295 List<T> Function(int x1, [List<Function> x2]) l2;
263 Expect.throws(() { l2 = (f2 as dynamic); }); 296 Expect.throws(() {
264 Expect.throws(() { l2 = confuse(f2); }); 297 l2 = (f2 as dynamic);
298 });
299 Expect.throws(() {
300 l2 = confuse(f2);
301 });
265 } 302 }
266 List<T> Function(int x1, [List<Function> x2]) l2 = m2; 303 List<T> Function(int x1, [List<Function> x2]) l2 = m2;
267 // In checked mode, verifies the type. 304 // In checked mode, verifies the type.
268 x2 = m2; 305 x2 = m2;
269 x2 = confuse(m2); 306 x2 = confuse(m2);
270 } 307 }
271 } 308 }
272 309
273 /// void Function([Function x1]) 310 /// void Function([Function x1])
274 void testF3() { 311 void testF3() {
(...skipping 10 matching lines...) Expand all
285 } 322 }
286 323
287 Expect.isTrue(m3 is F3); 324 Expect.isTrue(m3 is F3);
288 Expect.isTrue(m3 is void Function([Function x1])); 325 Expect.isTrue(m3 is void Function([Function x1]));
289 Expect.isTrue(confuse(m3) is F3); 326 Expect.isTrue(confuse(m3) is F3);
290 // In checked mode, verifies the type. 327 // In checked mode, verifies the type.
291 x3 = m3; 328 x3 = m3;
292 l3 = m3; 329 l3 = m3;
293 x3 = confuse(m3); 330 x3 = confuse(m3);
294 l3 = confuse(m3); 331 l3 = confuse(m3);
295
296 } 332 }
297 333
298 /// List<A> Function<A>(List<T> x) 334 /// List<A> Function<A>(List<T> x)
299 void testF4() { 335 void testF4() {
300 Expect.isTrue(f4 is F4); 336 Expect.isTrue(f4 is F4);
301 Expect.isTrue(confuse(f4) is F4); 337 Expect.isTrue(confuse(f4) is F4);
302 // In checked mode, verifies the type. 338 // In checked mode, verifies the type.
303 List<A> Function<A>(List<T> x) l4; 339 List<A> Function<A>(List<T> x) l4;
304 // The static function f4 sets `T` to `int`. 340 // The static function f4 sets `T` to `int`.
305 if (!tIsBool) { 341 if (!tIsBool) {
(...skipping 13 matching lines...) Expand all
319 l4 = confuse(m4); 355 l4 = confuse(m4);
320 if (!tIsBool) { 356 if (!tIsBool) {
321 Expect.isTrue(f4 is F4<int>); 357 Expect.isTrue(f4 is F4<int>);
322 Expect.isFalse(f4 is F4<bool>); 358 Expect.isFalse(f4 is F4<bool>);
323 Expect.isTrue(confuse(f4) is F4<int>); 359 Expect.isTrue(confuse(f4) is F4<int>);
324 Expect.isFalse(confuse(f4) is F4<bool>); 360 Expect.isFalse(confuse(f4) is F4<bool>);
325 Expect.equals(tIsDynamic, m4 is F4<bool>); 361 Expect.equals(tIsDynamic, m4 is F4<bool>);
326 Expect.equals(tIsDynamic, confuse(m4) is F4<bool>); 362 Expect.equals(tIsDynamic, confuse(m4) is F4<bool>);
327 } else { 363 } else {
328 if (inCheckedMode) { 364 if (inCheckedMode) {
329 Expect.throws(() { x4 = (f4 as dynamic); }); 365 Expect.throws(() {
330 Expect.throws(() { x4 = confuse(f4); }); 366 x4 = (f4 as dynamic);
367 });
368 Expect.throws(() {
369 x4 = confuse(f4);
370 });
331 List<A> Function<A>(List<T> x) l4; 371 List<A> Function<A>(List<T> x) l4;
332 Expect.throws(() { l4 = (f4 as dynamic); }); 372 Expect.throws(() {
333 Expect.throws(() { l4 = confuse(f4); }); 373 l4 = (f4 as dynamic);
374 });
375 Expect.throws(() {
376 l4 = confuse(f4);
377 });
334 } 378 }
335 List<A> Function<A>(List<T> x) l4 = m4; 379 List<A> Function<A>(List<T> x) l4 = m4;
336 // In checked mode, verifies the type. 380 // In checked mode, verifies the type.
337 x4 = m4; 381 x4 = m4;
338 x4 = confuse(m4); 382 x4 = confuse(m4);
339 } 383 }
340 } 384 }
341 385
342 /// int Function(List<Function> x) Function() 386 /// int Function(List<Function> x) Function()
343 void testF5() { 387 void testF5() {
(...skipping 10 matching lines...) Expand all
354 } 398 }
355 399
356 Expect.isTrue(m5 is F5); 400 Expect.isTrue(m5 is F5);
357 Expect.isTrue(m5 is int Function(List<Function> x) Function()); 401 Expect.isTrue(m5 is int Function(List<Function> x) Function());
358 Expect.isTrue(confuse(m5) is F5); 402 Expect.isTrue(confuse(m5) is F5);
359 // In checked mode, verifies the type. 403 // In checked mode, verifies the type.
360 x5 = m5; 404 x5 = m5;
361 l5 = m5; 405 l5 = m5;
362 x5 = confuse(m5); 406 x5 = confuse(m5);
363 l5 = confuse(m5); 407 l5 = confuse(m5);
364
365 } 408 }
366 409
367 /// int Function(int y, [List<T> x]) Function() 410 /// int Function(int y, [List<T> x]) Function()
368 void testF6() { 411 void testF6() {
369 Expect.isTrue(f6 is F6); 412 Expect.isTrue(f6 is F6);
370 Expect.isTrue(confuse(f6) is F6); 413 Expect.isTrue(confuse(f6) is F6);
371 // In checked mode, verifies the type. 414 // In checked mode, verifies the type.
372 int Function(int y, [List<T> x]) Function() l6; 415 int Function(int y, [List<T> x]) Function() l6;
373 // The static function f6 sets `T` to `int`. 416 // The static function f6 sets `T` to `int`.
374 if (!tIsBool) { 417 if (!tIsBool) {
(...skipping 13 matching lines...) Expand all
388 l6 = confuse(m6); 431 l6 = confuse(m6);
389 if (!tIsBool) { 432 if (!tIsBool) {
390 Expect.isTrue(f6 is F6<int>); 433 Expect.isTrue(f6 is F6<int>);
391 Expect.isFalse(f6 is F6<bool>); 434 Expect.isFalse(f6 is F6<bool>);
392 Expect.isTrue(confuse(f6) is F6<int>); 435 Expect.isTrue(confuse(f6) is F6<int>);
393 Expect.isFalse(confuse(f6) is F6<bool>); 436 Expect.isFalse(confuse(f6) is F6<bool>);
394 Expect.equals(tIsDynamic, m6 is F6<bool>); 437 Expect.equals(tIsDynamic, m6 is F6<bool>);
395 Expect.equals(tIsDynamic, confuse(m6) is F6<bool>); 438 Expect.equals(tIsDynamic, confuse(m6) is F6<bool>);
396 } else { 439 } else {
397 if (inCheckedMode) { 440 if (inCheckedMode) {
398 Expect.throws(() { x6 = (f6 as dynamic); }); 441 Expect.throws(() {
399 Expect.throws(() { x6 = confuse(f6); }); 442 x6 = (f6 as dynamic);
443 });
444 Expect.throws(() {
445 x6 = confuse(f6);
446 });
400 int Function(int y, [List<T> x]) Function() l6; 447 int Function(int y, [List<T> x]) Function() l6;
401 Expect.throws(() { l6 = (f6 as dynamic); }); 448 Expect.throws(() {
402 Expect.throws(() { l6 = confuse(f6); }); 449 l6 = (f6 as dynamic);
450 });
451 Expect.throws(() {
452 l6 = confuse(f6);
453 });
403 } 454 }
404 int Function(int y, [List<T> x]) Function() l6 = m6; 455 int Function(int y, [List<T> x]) Function() l6 = m6;
405 // In checked mode, verifies the type. 456 // In checked mode, verifies the type.
406 x6 = m6; 457 x6 = m6;
407 x6 = confuse(m6); 458 x6 = confuse(m6);
408 } 459 }
409 } 460 }
410 461
411 /// Function Function([Function x1]) Function() 462 /// Function Function([Function x1]) Function()
412 void testF7() { 463 void testF7() {
(...skipping 10 matching lines...) Expand all
423 } 474 }
424 475
425 Expect.isTrue(m7 is F7); 476 Expect.isTrue(m7 is F7);
426 Expect.isTrue(m7 is Function Function([Function x1]) Function()); 477 Expect.isTrue(m7 is Function Function([Function x1]) Function());
427 Expect.isTrue(confuse(m7) is F7); 478 Expect.isTrue(confuse(m7) is F7);
428 // In checked mode, verifies the type. 479 // In checked mode, verifies the type.
429 x7 = m7; 480 x7 = m7;
430 l7 = m7; 481 l7 = m7;
431 x7 = confuse(m7); 482 x7 = confuse(m7);
432 l7 = confuse(m7); 483 l7 = confuse(m7);
433
434 } 484 }
435 485
436 /// Function Function({core.List<core.int> x}) Function() 486 /// Function Function({core.List<core.int> x}) Function()
437 void testF8() { 487 void testF8() {
438 Expect.isTrue(f8 is F8); 488 Expect.isTrue(f8 is F8);
439 Expect.isTrue(confuse(f8) is F8); 489 Expect.isTrue(confuse(f8) is F8);
440 // In checked mode, verifies the type. 490 // In checked mode, verifies the type.
441 Function Function({core.List<core.int> x}) Function() l8; 491 Function Function({core.List<core.int> x}) Function() l8;
442 // The static function f8 sets `T` to `int`. 492 // The static function f8 sets `T` to `int`.
443 if (!tIsBool) { 493 if (!tIsBool) {
444 x8 = f8 as dynamic; 494 x8 = f8 as dynamic;
445 l8 = f8 as dynamic; 495 l8 = f8 as dynamic;
446 x8 = confuse(f8); 496 x8 = confuse(f8);
447 l8 = confuse(f8); 497 l8 = confuse(f8);
448 } 498 }
449 499
450 Expect.isTrue(m8 is F8); 500 Expect.isTrue(m8 is F8);
451 Expect.isTrue(m8 is Function Function({core.List<core.int> x}) Function()); 501 Expect.isTrue(m8 is Function Function({core.List<core.int> x}) Function());
452 Expect.isTrue(confuse(m8) is F8); 502 Expect.isTrue(confuse(m8) is F8);
453 // In checked mode, verifies the type. 503 // In checked mode, verifies the type.
454 x8 = m8; 504 x8 = m8;
455 l8 = m8; 505 l8 = m8;
456 x8 = confuse(m8); 506 x8 = confuse(m8);
457 l8 = confuse(m8); 507 l8 = confuse(m8);
458
459 } 508 }
460 509
461 /// List<Function> Function(int y, {int x}) Function() 510 /// List<Function> Function(int y, {int x}) Function()
462 void testF9() { 511 void testF9() {
463 Expect.isTrue(f9 is F9); 512 Expect.isTrue(f9 is F9);
464 Expect.isTrue(confuse(f9) is F9); 513 Expect.isTrue(confuse(f9) is F9);
465 // In checked mode, verifies the type. 514 // In checked mode, verifies the type.
466 List<Function> Function(int y, {int x}) Function() l9; 515 List<Function> Function(int y, {int x}) Function() l9;
467 // The static function f9 sets `T` to `int`. 516 // The static function f9 sets `T` to `int`.
468 if (!tIsBool) { 517 if (!tIsBool) {
469 x9 = f9 as dynamic; 518 x9 = f9 as dynamic;
470 l9 = f9 as dynamic; 519 l9 = f9 as dynamic;
471 x9 = confuse(f9); 520 x9 = confuse(f9);
472 l9 = confuse(f9); 521 l9 = confuse(f9);
473 } 522 }
474 523
475 Expect.isTrue(m9 is F9); 524 Expect.isTrue(m9 is F9);
476 Expect.isTrue(m9 is List<Function> Function(int y, {int x}) Function()); 525 Expect.isTrue(m9 is List<Function> Function(int y, {int x}) Function());
477 Expect.isTrue(confuse(m9) is F9); 526 Expect.isTrue(confuse(m9) is F9);
478 // In checked mode, verifies the type. 527 // In checked mode, verifies the type.
479 x9 = m9; 528 x9 = m9;
480 l9 = m9; 529 l9 = m9;
481 x9 = confuse(m9); 530 x9 = confuse(m9);
482 l9 = confuse(m9); 531 l9 = confuse(m9);
483
484 } 532 }
485 533
486 /// List<Function> Function(int x0, [core.List<core.int> x]) Function() 534 /// List<Function> Function(int x0, [core.List<core.int> x]) Function()
487 void testF10() { 535 void testF10() {
488 Expect.isTrue(f10 is F10); 536 Expect.isTrue(f10 is F10);
489 Expect.isTrue(confuse(f10) is F10); 537 Expect.isTrue(confuse(f10) is F10);
490 // In checked mode, verifies the type. 538 // In checked mode, verifies the type.
491 List<Function> Function(int x0, [core.List<core.int> x]) Function() l10; 539 List<Function> Function(int x0, [core.List<core.int> x]) Function() l10;
492 // The static function f10 sets `T` to `int`. 540 // The static function f10 sets `T` to `int`.
493 if (!tIsBool) { 541 if (!tIsBool) {
494 x10 = f10 as dynamic; 542 x10 = f10 as dynamic;
495 l10 = f10 as dynamic; 543 l10 = f10 as dynamic;
496 x10 = confuse(f10); 544 x10 = confuse(f10);
497 l10 = confuse(f10); 545 l10 = confuse(f10);
498 } 546 }
499 547
500 Expect.isTrue(m10 is F10); 548 Expect.isTrue(m10 is F10);
501 Expect.isTrue(m10 is List<Function> Function(int x0, [core.List<core.int> x] ) Function()); 549 Expect.isTrue(m10 is List<Function> Function(int x0,
550 [core.List<core.int> x]) Function());
502 Expect.isTrue(confuse(m10) is F10); 551 Expect.isTrue(confuse(m10) is F10);
503 // In checked mode, verifies the type. 552 // In checked mode, verifies the type.
504 x10 = m10; 553 x10 = m10;
505 l10 = m10; 554 l10 = m10;
506 x10 = confuse(m10); 555 x10 = confuse(m10);
507 l10 = confuse(m10); 556 l10 = confuse(m10);
508
509 } 557 }
510 558
511 /// core.List<core.int> Function(int x0) Function() 559 /// core.List<core.int> Function(int x0) Function()
512 void testF11() { 560 void testF11() {
513 Expect.isTrue(f11 is F11); 561 Expect.isTrue(f11 is F11);
514 Expect.isTrue(confuse(f11) is F11); 562 Expect.isTrue(confuse(f11) is F11);
515 // In checked mode, verifies the type. 563 // In checked mode, verifies the type.
516 core.List<core.int> Function(int x0) Function() l11; 564 core.List<core.int> Function(int x0) Function() l11;
517 // The static function f11 sets `T` to `int`. 565 // The static function f11 sets `T` to `int`.
518 if (!tIsBool) { 566 if (!tIsBool) {
519 x11 = f11 as dynamic; 567 x11 = f11 as dynamic;
520 l11 = f11 as dynamic; 568 l11 = f11 as dynamic;
521 x11 = confuse(f11); 569 x11 = confuse(f11);
522 l11 = confuse(f11); 570 l11 = confuse(f11);
523 } 571 }
524 572
525 Expect.isTrue(m11 is F11); 573 Expect.isTrue(m11 is F11);
526 Expect.isTrue(m11 is core.List<core.int> Function(int x0) Function()); 574 Expect.isTrue(m11 is core.List<core.int> Function(int x0) Function());
527 Expect.isTrue(confuse(m11) is F11); 575 Expect.isTrue(confuse(m11) is F11);
528 // In checked mode, verifies the type. 576 // In checked mode, verifies the type.
529 x11 = m11; 577 x11 = m11;
530 l11 = m11; 578 l11 = m11;
531 x11 = confuse(m11); 579 x11 = confuse(m11);
532 l11 = confuse(m11); 580 l11 = confuse(m11);
533
534 } 581 }
535 582
536 /// core.List<core.int> Function(int x, [List<Function> x2]) Function() 583 /// core.List<core.int> Function(int x, [List<Function> x2]) Function()
537 void testF12() { 584 void testF12() {
538 Expect.isTrue(f12 is F12); 585 Expect.isTrue(f12 is F12);
539 Expect.isTrue(confuse(f12) is F12); 586 Expect.isTrue(confuse(f12) is F12);
540 // In checked mode, verifies the type. 587 // In checked mode, verifies the type.
541 core.List<core.int> Function(int x, [List<Function> x2]) Function() l12; 588 core.List<core.int> Function(int x, [List<Function> x2]) Function() l12;
542 // The static function f12 sets `T` to `int`. 589 // The static function f12 sets `T` to `int`.
543 if (!tIsBool) { 590 if (!tIsBool) {
544 x12 = f12 as dynamic; 591 x12 = f12 as dynamic;
545 l12 = f12 as dynamic; 592 l12 = f12 as dynamic;
546 x12 = confuse(f12); 593 x12 = confuse(f12);
547 l12 = confuse(f12); 594 l12 = confuse(f12);
548 } 595 }
549 596
550 Expect.isTrue(m12 is F12); 597 Expect.isTrue(m12 is F12);
551 Expect.isTrue(m12 is core.List<core.int> Function(int x, [List<Function> x2] ) Function()); 598 Expect.isTrue(m12 is core.List<core.int> Function(int x,
599 [List<Function> x2]) Function());
552 Expect.isTrue(confuse(m12) is F12); 600 Expect.isTrue(confuse(m12) is F12);
553 // In checked mode, verifies the type. 601 // In checked mode, verifies the type.
554 x12 = m12; 602 x12 = m12;
555 l12 = m12; 603 l12 = m12;
556 x12 = confuse(m12); 604 x12 = confuse(m12);
557 l12 = confuse(m12); 605 l12 = confuse(m12);
558
559 } 606 }
560 607
561 /// core.List<core.int> Function(int y, {List<T> x}) Function() 608 /// core.List<core.int> Function(int y, {List<T> x}) Function()
562 void testF13() { 609 void testF13() {
563 Expect.isTrue(f13 is F13); 610 Expect.isTrue(f13 is F13);
564 Expect.isTrue(confuse(f13) is F13); 611 Expect.isTrue(confuse(f13) is F13);
565 // In checked mode, verifies the type. 612 // In checked mode, verifies the type.
566 core.List<core.int> Function(int y, {List<T> x}) Function() l13; 613 core.List<core.int> Function(int y, {List<T> x}) Function() l13;
567 // The static function f13 sets `T` to `int`. 614 // The static function f13 sets `T` to `int`.
568 if (!tIsBool) { 615 if (!tIsBool) {
569 x13 = f13 as dynamic; 616 x13 = f13 as dynamic;
570 l13 = f13 as dynamic; 617 l13 = f13 as dynamic;
571 x13 = confuse(f13); 618 x13 = confuse(f13);
572 l13 = confuse(f13); 619 l13 = confuse(f13);
573 } 620 }
574 621
575 Expect.isTrue(m13 is F13); 622 Expect.isTrue(m13 is F13);
576 Expect.isTrue(m13 is core.List<core.int> Function(int y, {List<T> x}) Functi on()); 623 Expect.isTrue(
624 m13 is core.List<core.int> Function(int y, {List<T> x}) Function());
577 Expect.isTrue(confuse(m13) is F13); 625 Expect.isTrue(confuse(m13) is F13);
578 // In checked mode, verifies the type. 626 // In checked mode, verifies the type.
579 x13 = m13; 627 x13 = m13;
580 l13 = m13; 628 l13 = m13;
581 x13 = confuse(m13); 629 x13 = confuse(m13);
582 l13 = confuse(m13); 630 l13 = confuse(m13);
583 if (!tIsBool) { 631 if (!tIsBool) {
584 Expect.isTrue(f13 is F13<int>); 632 Expect.isTrue(f13 is F13<int>);
585 Expect.isFalse(f13 is F13<bool>); 633 Expect.isFalse(f13 is F13<bool>);
586 Expect.isTrue(confuse(f13) is F13<int>); 634 Expect.isTrue(confuse(f13) is F13<int>);
587 Expect.isFalse(confuse(f13) is F13<bool>); 635 Expect.isFalse(confuse(f13) is F13<bool>);
588 Expect.equals(tIsDynamic, m13 is F13<bool>); 636 Expect.equals(tIsDynamic, m13 is F13<bool>);
589 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); 637 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>);
590 } else { 638 } else {
591 if (inCheckedMode) { 639 if (inCheckedMode) {
592 Expect.throws(() { x13 = (f13 as dynamic); }); 640 Expect.throws(() {
593 Expect.throws(() { x13 = confuse(f13); }); 641 x13 = (f13 as dynamic);
642 });
643 Expect.throws(() {
644 x13 = confuse(f13);
645 });
594 core.List<core.int> Function(int y, {List<T> x}) Function() l13; 646 core.List<core.int> Function(int y, {List<T> x}) Function() l13;
595 Expect.throws(() { l13 = (f13 as dynamic); }); 647 Expect.throws(() {
596 Expect.throws(() { l13 = confuse(f13); }); 648 l13 = (f13 as dynamic);
649 });
650 Expect.throws(() {
651 l13 = confuse(f13);
652 });
597 } 653 }
598 core.List<core.int> Function(int y, {List<T> x}) Function() l13 = m13; 654 core.List<core.int> Function(int y, {List<T> x}) Function() l13 = m13;
599 // In checked mode, verifies the type. 655 // In checked mode, verifies the type.
600 x13 = m13; 656 x13 = m13;
601 x13 = confuse(m13); 657 x13 = confuse(m13);
602 } 658 }
603 } 659 }
604 660
605 /// List<T> Function([List<Function> x]) Function() 661 /// List<T> Function([List<Function> x]) Function()
606 void testF14() { 662 void testF14() {
(...skipping 19 matching lines...) Expand all
626 l14 = confuse(m14); 682 l14 = confuse(m14);
627 if (!tIsBool) { 683 if (!tIsBool) {
628 Expect.isTrue(f14 is F14<int>); 684 Expect.isTrue(f14 is F14<int>);
629 Expect.isFalse(f14 is F14<bool>); 685 Expect.isFalse(f14 is F14<bool>);
630 Expect.isTrue(confuse(f14) is F14<int>); 686 Expect.isTrue(confuse(f14) is F14<int>);
631 Expect.isFalse(confuse(f14) is F14<bool>); 687 Expect.isFalse(confuse(f14) is F14<bool>);
632 Expect.equals(tIsDynamic, m14 is F14<bool>); 688 Expect.equals(tIsDynamic, m14 is F14<bool>);
633 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); 689 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>);
634 } else { 690 } else {
635 if (inCheckedMode) { 691 if (inCheckedMode) {
636 Expect.throws(() { x14 = (f14 as dynamic); }); 692 Expect.throws(() {
637 Expect.throws(() { x14 = confuse(f14); }); 693 x14 = (f14 as dynamic);
694 });
695 Expect.throws(() {
696 x14 = confuse(f14);
697 });
638 List<T> Function([List<Function> x]) Function() l14; 698 List<T> Function([List<Function> x]) Function() l14;
639 Expect.throws(() { l14 = (f14 as dynamic); }); 699 Expect.throws(() {
640 Expect.throws(() { l14 = confuse(f14); }); 700 l14 = (f14 as dynamic);
701 });
702 Expect.throws(() {
703 l14 = confuse(f14);
704 });
641 } 705 }
642 List<T> Function([List<Function> x]) Function() l14 = m14; 706 List<T> Function([List<Function> x]) Function() l14 = m14;
643 // In checked mode, verifies the type. 707 // In checked mode, verifies the type.
644 x14 = m14; 708 x14 = m14;
645 x14 = confuse(m14); 709 x14 = confuse(m14);
646 } 710 }
647 } 711 }
648 712
649 /// List<T> Function(List<T> x0) Function() 713 /// List<T> Function(List<T> x0) Function()
650 void testF15() { 714 void testF15() {
(...skipping 19 matching lines...) Expand all
670 l15 = confuse(m15); 734 l15 = confuse(m15);
671 if (!tIsBool) { 735 if (!tIsBool) {
672 Expect.isTrue(f15 is F15<int>); 736 Expect.isTrue(f15 is F15<int>);
673 Expect.isFalse(f15 is F15<bool>); 737 Expect.isFalse(f15 is F15<bool>);
674 Expect.isTrue(confuse(f15) is F15<int>); 738 Expect.isTrue(confuse(f15) is F15<int>);
675 Expect.isFalse(confuse(f15) is F15<bool>); 739 Expect.isFalse(confuse(f15) is F15<bool>);
676 Expect.equals(tIsDynamic, m15 is F15<bool>); 740 Expect.equals(tIsDynamic, m15 is F15<bool>);
677 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); 741 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>);
678 } else { 742 } else {
679 if (inCheckedMode) { 743 if (inCheckedMode) {
680 Expect.throws(() { x15 = (f15 as dynamic); }); 744 Expect.throws(() {
681 Expect.throws(() { x15 = confuse(f15); }); 745 x15 = (f15 as dynamic);
746 });
747 Expect.throws(() {
748 x15 = confuse(f15);
749 });
682 List<T> Function(List<T> x0) Function() l15; 750 List<T> Function(List<T> x0) Function() l15;
683 Expect.throws(() { l15 = (f15 as dynamic); }); 751 Expect.throws(() {
684 Expect.throws(() { l15 = confuse(f15); }); 752 l15 = (f15 as dynamic);
753 });
754 Expect.throws(() {
755 l15 = confuse(f15);
756 });
685 } 757 }
686 List<T> Function(List<T> x0) Function() l15 = m15; 758 List<T> Function(List<T> x0) Function() l15 = m15;
687 // In checked mode, verifies the type. 759 // In checked mode, verifies the type.
688 x15 = m15; 760 x15 = m15;
689 x15 = confuse(m15); 761 x15 = confuse(m15);
690 } 762 }
691 } 763 }
692 764
693 /// Function(int x1, [Function x2]) Function() 765 /// Function(int x1, [Function x2]) Function()
694 void testF16() { 766 void testF16() {
(...skipping 10 matching lines...) Expand all
705 } 777 }
706 778
707 Expect.isTrue(m16 is F16); 779 Expect.isTrue(m16 is F16);
708 Expect.isTrue(m16 is Function(int x1, [Function x2]) Function()); 780 Expect.isTrue(m16 is Function(int x1, [Function x2]) Function());
709 Expect.isTrue(confuse(m16) is F16); 781 Expect.isTrue(confuse(m16) is F16);
710 // In checked mode, verifies the type. 782 // In checked mode, verifies the type.
711 x16 = m16; 783 x16 = m16;
712 l16 = m16; 784 l16 = m16;
713 x16 = confuse(m16); 785 x16 = confuse(m16);
714 l16 = confuse(m16); 786 l16 = confuse(m16);
715
716 } 787 }
717 788
718 /// Function(int x0, {core.List<core.int> x}) Function() 789 /// Function(int x0, {core.List<core.int> x}) Function()
719 void testF17() { 790 void testF17() {
720 Expect.isTrue(f17 is F17); 791 Expect.isTrue(f17 is F17);
721 Expect.isTrue(confuse(f17) is F17); 792 Expect.isTrue(confuse(f17) is F17);
722 // In checked mode, verifies the type. 793 // In checked mode, verifies the type.
723 Function(int x0, {core.List<core.int> x}) Function() l17; 794 Function(int x0, {core.List<core.int> x}) Function() l17;
724 // The static function f17 sets `T` to `int`. 795 // The static function f17 sets `T` to `int`.
725 if (!tIsBool) { 796 if (!tIsBool) {
726 x17 = f17 as dynamic; 797 x17 = f17 as dynamic;
727 l17 = f17 as dynamic; 798 l17 = f17 as dynamic;
728 x17 = confuse(f17); 799 x17 = confuse(f17);
729 l17 = confuse(f17); 800 l17 = confuse(f17);
730 } 801 }
731 802
732 Expect.isTrue(m17 is F17); 803 Expect.isTrue(m17 is F17);
733 Expect.isTrue(m17 is Function(int x0, {core.List<core.int> x}) Function()); 804 Expect.isTrue(m17 is Function(int x0, {core.List<core.int> x}) Function());
734 Expect.isTrue(confuse(m17) is F17); 805 Expect.isTrue(confuse(m17) is F17);
735 // In checked mode, verifies the type. 806 // In checked mode, verifies the type.
736 x17 = m17; 807 x17 = m17;
737 l17 = m17; 808 l17 = m17;
738 x17 = confuse(m17); 809 x17 = confuse(m17);
739 l17 = confuse(m17); 810 l17 = confuse(m17);
740
741 } 811 }
742 812
743 /// void Function(Function x) Function() 813 /// void Function(Function x) Function()
744 void testF18() { 814 void testF18() {
745 Expect.isTrue(f18 is F18); 815 Expect.isTrue(f18 is F18);
746 Expect.isTrue(confuse(f18) is F18); 816 Expect.isTrue(confuse(f18) is F18);
747 // In checked mode, verifies the type. 817 // In checked mode, verifies the type.
748 void Function(Function x) Function() l18; 818 void Function(Function x) Function() l18;
749 // The static function f18 sets `T` to `int`. 819 // The static function f18 sets `T` to `int`.
750 if (!tIsBool) { 820 if (!tIsBool) {
751 x18 = f18 as dynamic; 821 x18 = f18 as dynamic;
752 l18 = f18 as dynamic; 822 l18 = f18 as dynamic;
753 x18 = confuse(f18); 823 x18 = confuse(f18);
754 l18 = confuse(f18); 824 l18 = confuse(f18);
755 } 825 }
756 826
757 Expect.isTrue(m18 is F18); 827 Expect.isTrue(m18 is F18);
758 Expect.isTrue(m18 is void Function(Function x) Function()); 828 Expect.isTrue(m18 is void Function(Function x) Function());
759 Expect.isTrue(confuse(m18) is F18); 829 Expect.isTrue(confuse(m18) is F18);
760 // In checked mode, verifies the type. 830 // In checked mode, verifies the type.
761 x18 = m18; 831 x18 = m18;
762 l18 = m18; 832 l18 = m18;
763 x18 = confuse(m18); 833 x18 = confuse(m18);
764 l18 = confuse(m18); 834 l18 = confuse(m18);
765
766 } 835 }
767 836
768 /// void Function(int y, [core.List<core.int> x]) Function() 837 /// void Function(int y, [core.List<core.int> x]) Function()
769 void testF19() { 838 void testF19() {
770 Expect.isTrue(f19 is F19); 839 Expect.isTrue(f19 is F19);
771 Expect.isTrue(confuse(f19) is F19); 840 Expect.isTrue(confuse(f19) is F19);
772 // In checked mode, verifies the type. 841 // In checked mode, verifies the type.
773 void Function(int y, [core.List<core.int> x]) Function() l19; 842 void Function(int y, [core.List<core.int> x]) Function() l19;
774 // The static function f19 sets `T` to `int`. 843 // The static function f19 sets `T` to `int`.
775 if (!tIsBool) { 844 if (!tIsBool) {
776 x19 = f19 as dynamic; 845 x19 = f19 as dynamic;
777 l19 = f19 as dynamic; 846 l19 = f19 as dynamic;
778 x19 = confuse(f19); 847 x19 = confuse(f19);
779 l19 = confuse(f19); 848 l19 = confuse(f19);
780 } 849 }
781 850
782 Expect.isTrue(m19 is F19); 851 Expect.isTrue(m19 is F19);
783 Expect.isTrue(m19 is void Function(int y, [core.List<core.int> x]) Function( )); 852 Expect.isTrue(
853 m19 is void Function(int y, [core.List<core.int> x]) Function());
784 Expect.isTrue(confuse(m19) is F19); 854 Expect.isTrue(confuse(m19) is F19);
785 // In checked mode, verifies the type. 855 // In checked mode, verifies the type.
786 x19 = m19; 856 x19 = m19;
787 l19 = m19; 857 l19 = m19;
788 x19 = confuse(m19); 858 x19 = confuse(m19);
789 l19 = confuse(m19); 859 l19 = confuse(m19);
790
791 } 860 }
792 861
793 /// int Function<A>() Function() 862 /// int Function<A>() Function()
794 void testF20() { 863 void testF20() {
795 Expect.isTrue(f20 is F20); 864 Expect.isTrue(f20 is F20);
796 Expect.isTrue(confuse(f20) is F20); 865 Expect.isTrue(confuse(f20) is F20);
797 // In checked mode, verifies the type. 866 // In checked mode, verifies the type.
798 int Function<A>() Function() l20; 867 int Function<A>() Function() l20;
799 // The static function f20 sets `T` to `int`. 868 // The static function f20 sets `T` to `int`.
800 if (!tIsBool) { 869 if (!tIsBool) {
801 x20 = f20 as dynamic; 870 x20 = f20 as dynamic;
802 l20 = f20 as dynamic; 871 l20 = f20 as dynamic;
803 x20 = confuse(f20); 872 x20 = confuse(f20);
804 l20 = confuse(f20); 873 l20 = confuse(f20);
805 } 874 }
806 875
807 Expect.isTrue(m20 is F20); 876 Expect.isTrue(m20 is F20);
808 Expect.isTrue(m20 is int Function<A>() Function()); 877 Expect.isTrue(m20 is int Function<A>() Function());
809 Expect.isTrue(confuse(m20) is F20); 878 Expect.isTrue(confuse(m20) is F20);
810 // In checked mode, verifies the type. 879 // In checked mode, verifies the type.
811 x20 = m20; 880 x20 = m20;
812 l20 = m20; 881 l20 = m20;
813 x20 = confuse(m20); 882 x20 = confuse(m20);
814 l20 = confuse(m20); 883 l20 = confuse(m20);
815
816 } 884 }
817 885
818 /// core.List<core.int> Function<A>(A x) Function() 886 /// core.List<core.int> Function<A>(A x) Function()
819 void testF21() { 887 void testF21() {
820 Expect.isTrue(f21 is F21); 888 Expect.isTrue(f21 is F21);
821 Expect.isTrue(confuse(f21) is F21); 889 Expect.isTrue(confuse(f21) is F21);
822 // In checked mode, verifies the type. 890 // In checked mode, verifies the type.
823 core.List<core.int> Function<A>(A x) Function() l21; 891 core.List<core.int> Function<A>(A x) Function() l21;
824 // The static function f21 sets `T` to `int`. 892 // The static function f21 sets `T` to `int`.
825 if (!tIsBool) { 893 if (!tIsBool) {
826 x21 = f21 as dynamic; 894 x21 = f21 as dynamic;
827 l21 = f21 as dynamic; 895 l21 = f21 as dynamic;
828 x21 = confuse(f21); 896 x21 = confuse(f21);
829 l21 = confuse(f21); 897 l21 = confuse(f21);
830 } 898 }
831 899
832 Expect.isTrue(m21 is F21); 900 Expect.isTrue(m21 is F21);
833 Expect.isTrue(m21 is core.List<core.int> Function<A>(A x) Function()); 901 Expect.isTrue(m21 is core.List<core.int> Function<A>(A x) Function());
834 Expect.isTrue(confuse(m21) is F21); 902 Expect.isTrue(confuse(m21) is F21);
835 // In checked mode, verifies the type. 903 // In checked mode, verifies the type.
836 x21 = m21; 904 x21 = m21;
837 l21 = m21; 905 l21 = m21;
838 x21 = confuse(m21); 906 x21 = confuse(m21);
839 l21 = confuse(m21); 907 l21 = confuse(m21);
840
841 } 908 }
842 909
843 /// A Function<A>(List<A> x) Function() 910 /// A Function<A>(List<A> x) Function()
844 void testF22() { 911 void testF22() {
845 Expect.isTrue(f22 is F22); 912 Expect.isTrue(f22 is F22);
846 Expect.isTrue(confuse(f22) is F22); 913 Expect.isTrue(confuse(f22) is F22);
847 // In checked mode, verifies the type. 914 // In checked mode, verifies the type.
848 A Function<A>(List<A> x) Function() l22; 915 A Function<A>(List<A> x) Function() l22;
849 // The static function f22 sets `T` to `int`. 916 // The static function f22 sets `T` to `int`.
850 if (!tIsBool) { 917 if (!tIsBool) {
851 x22 = f22 as dynamic; 918 x22 = f22 as dynamic;
852 l22 = f22 as dynamic; 919 l22 = f22 as dynamic;
853 x22 = confuse(f22); 920 x22 = confuse(f22);
854 l22 = confuse(f22); 921 l22 = confuse(f22);
855 } 922 }
856 923
857 Expect.isTrue(m22 is F22); 924 Expect.isTrue(m22 is F22);
858 Expect.isTrue(m22 is A Function<A>(List<A> x) Function()); 925 Expect.isTrue(m22 is A Function<A>(List<A> x) Function());
859 Expect.isTrue(confuse(m22) is F22); 926 Expect.isTrue(confuse(m22) is F22);
860 // In checked mode, verifies the type. 927 // In checked mode, verifies the type.
861 x22 = m22; 928 x22 = m22;
862 l22 = m22; 929 l22 = m22;
863 x22 = confuse(m22); 930 x22 = confuse(m22);
864 l22 = confuse(m22); 931 l22 = confuse(m22);
865
866 } 932 }
867
868
869 } 933 }
870 934
871 void main() { 935 void main() {
872 new U52().runTests(); 936 new U52().runTests();
873 new U52<int>(tIsInt: true).runTests(); 937 new U52<int>(tIsInt: true).runTests();
874 new U52<bool>(tIsBool: true).runTests(); 938 new U52<bool>(tIsBool: true).runTests();
875 } 939 }
876
OLDNEW
« no previous file with comments | « tests/language/function_type/function_type51_test.dart ('k') | tests/language/function_type/function_type53_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698