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