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

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

Powered by Google App Engine
This is Rietveld 408576698