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