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

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

Powered by Google App Engine
This is Rietveld 408576698