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

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

Powered by Google App Engine
This is Rietveld 408576698