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