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