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