| 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(core.List<core.int> x); | 29 = int Function(core.List<core.int> x); |
| 27 typedef F1<T> = List<Function> Function(int y, {Function x}); | 30 typedef F1<T> |
| 28 typedef F2<T> = List<T> Function(int x0, {int x}); | 31 = List<Function> Function(int y, {Function x}); |
| 29 typedef F3<T> = Function(int x0, {List<T> x}); | 32 typedef F2<T> |
| 30 typedef F4<T> = Function<A>(Function x); | 33 = List<T> Function(int x0, {int x}); |
| 31 typedef F5<T> = int Function(int x2, [Function x3]) Function(int x); | 34 typedef F3<T> |
| 32 typedef F6<T> = int Function(int x1, {core.List<core.int> x}) Function(int x); | 35 = Function(int x0, {List<T> x}); |
| 33 typedef F7<T> = Function Function(Function x) Function(int x); | 36 typedef F4<T> |
| 34 typedef F8<T> = Function Function(int y, [core.List<core.int> x]) Function(int x
); | 37 = Function<A>(Function x); |
| 35 typedef F9<T> = List<Function> Function([int x1]) Function(int x); | 38 typedef F5<T> |
| 36 typedef F10<T> = List<Function> Function({List<Function> x}) Function(int x); | 39 = int Function(int x2, [Function x3]) Function(int x); |
| 37 typedef F11<T> = List<Function> Function() Function(int x); | 40 typedef F6<T> |
| 38 typedef F12<T> = core.List<core.int> Function(int x1, [List<Function> x]) Functi
on(int x); | 41 = int Function(int x1, {core.List<core.int> x}) Function(int x); |
| 39 typedef F13<T> = core.List<core.int> Function([List<T> x1]) Function(int x); | 42 typedef F7<T> |
| 40 typedef F14<T> = List<T> Function(int x, [Function x1]) Function(int x); | 43 = Function Function(Function x) Function(int x); |
| 41 typedef F15<T> = List<T> Function(int y, {core.List<core.int> x}) Function(int x
); | 44 typedef F8<T> |
| 42 typedef F16<T> = Function([Function x]) Function(int x); | 45 = Function Function(int y, [core.List<core.int> x]) Function(int x); |
| 43 typedef F17<T> = Function(core.List<core.int> x1) Function(int x); | 46 typedef F9<T> |
| 44 typedef F18<T> = void Function(int x2, [int x3]) Function(int x); | 47 = List<Function> Function([int x1]) Function(int x); |
| 45 typedef F19<T> = void Function(int x1, {List<Function> x}) Function(int x); | 48 typedef F10<T> |
| 46 typedef F20<T> = int Function<A>(int x) Function(int x); | 49 = List<Function> Function({List<Function> x}) Function(int x); |
| 47 typedef F21<T> = core.List<core.int> Function<A>(Function x) Function(int x); | 50 typedef F11<T> |
| 48 typedef F22<T> = A Function<A>(List<Function> x) Function(int x); | 51 = List<Function> Function() Function(int x); |
| 49 typedef F23<T> = B Function(B x) Function<B extends core.int>(int x); | 52 typedef F12<T> |
| 50 | 53 = core.List<core.int> Function(int x1, [List<Function> x]) Function(int x); |
| 54 typedef F13<T> |
| 55 = core.List<core.int> Function([List<T> x1]) Function(int x); |
| 56 typedef F14<T> |
| 57 = List<T> Function(int x, [Function x1]) Function(int x); |
| 58 typedef F15<T> |
| 59 = List<T> Function(int y, {core.List<core.int> x}) Function(int x); |
| 60 typedef F16<T> |
| 61 = Function([Function x]) Function(int x); |
| 62 typedef F17<T> |
| 63 = Function(core.List<core.int> x1) Function(int x); |
| 64 typedef F18<T> |
| 65 = void Function(int x2, [int x3]) Function(int x); |
| 66 typedef F19<T> |
| 67 = void Function(int x1, {List<Function> x}) Function(int x); |
| 68 typedef F20<T> |
| 69 = int Function<A>(int x) Function(int x); |
| 70 typedef F21<T> |
| 71 = core.List<core.int> Function<A>(Function x) Function(int x); |
| 72 typedef F22<T> |
| 73 = A Function<A>(List<Function> x) Function(int x); |
| 74 typedef F23<T> |
| 75 = B Function(B x) Function<B extends core.int>(int x); |
| 51 | 76 |
| 52 int f0(core.List<core.int> x) => null; | 77 int f0(core.List<core.int> x) => null; |
| 53 List<Function> f1(int y, {Function x}) => null; | 78 List<Function> f1(int y, {Function x}) => null; |
| 54 List<int> f2(int x0, {int x}) => null; | 79 List<int> f2(int x0, {int x}) => null; |
| 55 f3(int x0, {List<int> x}) => null; | 80 f3(int x0, {List<int> x}) => null; |
| 56 f4<A>(Function x) => null; | 81 f4<A>(Function x) => null; |
| 57 int Function(int x0, [Function x1]) f5(int x) => null; | 82 int Function(int x0, [Function x1]) f5(int x) => null; |
| 58 int Function(int x0, {core.List<core.int> x}) f6(int x) => null; | 83 int Function(int x0, {core.List<core.int> x}) f6(int x) => null; |
| 59 Function Function(Function x) f7(int x) => null; | 84 Function Function(Function x) f7(int x) => null; |
| 60 Function Function(int y, [core.List<core.int> x]) f8(int x) => null; | 85 Function Function(int y, [core.List<core.int> x]) f8(int x) => null; |
| 61 List<Function> Function([int x0]) f9(int x) => null; | 86 List<Function> Function([int x0]) f9(int x) => null; |
| 62 List<Function> Function({List<Function> x}) f10(int x) => null; | 87 List<Function> Function({List<Function> x}) f10(int x) => null; |
| 63 List<Function> Function() f11(int x) => null; | 88 List<Function> Function() f11(int x) => null; |
| 64 core.List<core.int> Function(int x0, [List<Function> x]) f12(int x) => null; | 89 core.List<core.int> Function(int x0, [List<Function> x]) f12(int x) => null; |
| 65 core.List<core.int> Function([List<int> x0]) f13(int x) => null; | 90 core.List<core.int> Function([List<int> x0]) f13(int x) => null; |
| 66 List<int> Function(int x, [Function x0]) f14(int x) => null; | 91 List<int> Function(int x, [Function x0]) f14(int x) => null; |
| 67 List<int> Function(int y, {core.List<core.int> x}) f15(int x) => null; | 92 List<int> Function(int y, {core.List<core.int> x}) f15(int x) => null; |
| 68 Function([Function x]) f16(int x) => null; | 93 Function([Function x]) f16(int x) => null; |
| 69 Function(core.List<core.int> x0) f17(int x) => null; | 94 Function(core.List<core.int> x0) f17(int x) => null; |
| 70 void Function(int x0, [int x1]) f18(int x) => null; | 95 void Function(int x0, [int x1]) f18(int x) => null; |
| 71 void Function(int x0, {List<Function> x}) f19(int x) => null; | 96 void Function(int x0, {List<Function> x}) f19(int x) => null; |
| 72 int Function<A>(int x) f20(int x) => null; | 97 int Function<A>(int x) f20(int x) => null; |
| 73 core.List<core.int> Function<A>(Function x) f21(int x) => null; | 98 core.List<core.int> Function<A>(Function x) f21(int x) => null; |
| 74 A Function<A>(List<Function> x) f22(int x) => null; | 99 A Function<A>(List<Function> x) f22(int x) => null; |
| 75 B Function(B x) f23<B extends core.int>(int x) => null; | 100 B Function(B x) f23<B extends core.int>(int x) => null; |
| 76 | 101 |
| 77 | |
| 78 class U33<T> { | 102 class U33<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(core.List<core.int> x) x0; | 107 int Function(core.List<core.int> x) x0; |
| 84 List<Function> Function(int y, {Function x}) x1; | 108 List<Function> Function(int y, {Function x}) x1; |
| 85 List<T> Function(int x0, {int x}) x2; | 109 List<T> Function(int x0, {int x}) x2; |
| 86 Function(int x0, {List<T> x}) x3; | 110 Function(int x0, {List<T> x}) x3; |
| 87 Function<A>(Function x) x4; | 111 Function<A>(Function x) x4; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 98 List<T> Function(int y, {core.List<core.int> x}) Function(int x) x15; | 122 List<T> Function(int y, {core.List<core.int> x}) Function(int x) x15; |
| 99 Function([Function x]) Function(int x) x16; | 123 Function([Function x]) Function(int x) x16; |
| 100 Function(core.List<core.int> x1) Function(int x) x17; | 124 Function(core.List<core.int> x1) Function(int x) x17; |
| 101 void Function(int x2, [int x3]) Function(int x) x18; | 125 void Function(int x2, [int x3]) Function(int x) x18; |
| 102 void Function(int x1, {List<Function> x}) Function(int x) x19; | 126 void Function(int x1, {List<Function> x}) Function(int x) x19; |
| 103 int Function<A>(int x) Function(int x) x20; | 127 int Function<A>(int x) Function(int x) x20; |
| 104 core.List<core.int> Function<A>(Function x) Function(int x) x21; | 128 core.List<core.int> Function<A>(Function x) Function(int x) x21; |
| 105 A Function<A>(List<Function> x) Function(int x) x22; | 129 A Function<A>(List<Function> x) Function(int x) x22; |
| 106 B Function(B x) Function<B extends core.int>(int x) x23; | 130 B Function(B x) Function<B extends core.int>(int x) x23; |
| 107 | 131 |
| 108 | |
| 109 U33({this.tIsBool: false, this.tIsInt: false}) | 132 U33({this.tIsBool: false, this.tIsInt: false}) |
| 110 : tIsDynamic = !tIsBool && !tIsInt; | 133 : tIsDynamic = !tIsBool && !tIsInt; |
| 111 | 134 |
| 112 int m0(core.List<core.int> x) => null; | 135 int m0(core.List<core.int> x) => null; |
| 113 List<Function> m1(int y, {Function x}) => null; | 136 List<Function> m1(int y, {Function x}) => null; |
| 114 List<T> m2(int x0, {int x}) => null; | 137 List<T> m2(int x0, {int x}) => null; |
| 115 m3(int x0, {List<T> x}) => null; | 138 m3(int x0, {List<T> x}) => null; |
| 116 m4<A>(Function x) => null; | 139 m4<A>(Function x) => null; |
| 117 int Function(int x0, [Function x1]) m5(int x) => null; | 140 int Function(int x0, [Function x1]) m5(int x) => null; |
| 118 int Function(int x0, {core.List<core.int> x}) m6(int x) => null; | 141 int Function(int x0, {core.List<core.int> x}) m6(int x) => null; |
| 119 Function Function(Function x) m7(int x) => null; | 142 Function Function(Function x) m7(int x) => null; |
| 120 Function Function(int y, [core.List<core.int> x]) m8(int x) => null; | 143 Function Function(int y, [core.List<core.int> x]) m8(int x) => null; |
| 121 List<Function> Function([int x0]) m9(int x) => null; | 144 List<Function> Function([int x0]) m9(int x) => null; |
| 122 List<Function> Function({List<Function> x}) m10(int x) => null; | 145 List<Function> Function({List<Function> x}) m10(int x) => null; |
| 123 List<Function> Function() m11(int x) => null; | 146 List<Function> Function() m11(int x) => null; |
| 124 core.List<core.int> Function(int x0, [List<Function> x]) m12(int x) => null; | 147 core.List<core.int> Function(int x0, [List<Function> x]) m12(int x) => null; |
| 125 core.List<core.int> Function([List<T> x0]) m13(int x) => null; | 148 core.List<core.int> Function([List<T> x0]) m13(int x) => null; |
| 126 List<T> Function(int x, [Function x0]) m14(int x) => null; | 149 List<T> Function(int x, [Function x0]) m14(int x) => null; |
| 127 List<T> Function(int y, {core.List<core.int> x}) m15(int x) => null; | 150 List<T> Function(int y, {core.List<core.int> x}) m15(int x) => null; |
| 128 Function([Function x]) m16(int x) => null; | 151 Function([Function x]) m16(int x) => null; |
| 129 Function(core.List<core.int> x0) m17(int x) => null; | 152 Function(core.List<core.int> x0) m17(int x) => null; |
| 130 void Function(int x0, [int x1]) m18(int x) => null; | 153 void Function(int x0, [int x1]) m18(int x) => null; |
| 131 void Function(int x0, {List<Function> x}) m19(int x) => null; | 154 void Function(int x0, {List<Function> x}) m19(int x) => null; |
| 132 int Function<A>(int x) m20(int x) => null; | 155 int Function<A>(int x) m20(int x) => null; |
| 133 core.List<core.int> Function<A>(Function x) m21(int x) => null; | 156 core.List<core.int> Function<A>(Function x) m21(int x) => null; |
| 134 A Function<A>(List<Function> x) m22(int x) => null; | 157 A Function<A>(List<Function> x) m22(int x) => null; |
| 135 B Function(B x) m23<B extends core.int>(int x) => null; | 158 B 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(core.List<core.int> x)); | 202 Expect.isTrue(m0 is int Function(core.List<core.int> x)); |
| 181 Expect.isTrue(confuse(m0) is F0); | 203 Expect.isTrue(confuse(m0) is F0); |
| 182 // In checked mode, verifies the type. | 204 // In checked mode, verifies the type. |
| 183 x0 = m0; | 205 x0 = m0; |
| 184 l0 = m0; | 206 l0 = m0; |
| 185 x0 = confuse(m0); | 207 x0 = confuse(m0); |
| 186 l0 = confuse(m0); | 208 l0 = confuse(m0); |
| 187 | |
| 188 } | 209 } |
| 189 | 210 |
| 190 /// List<Function> Function(int y, {Function x}) | 211 /// List<Function> Function(int y, {Function x}) |
| 191 void testF1() { | 212 void testF1() { |
| 192 Expect.isTrue(f1 is F1); | 213 Expect.isTrue(f1 is F1); |
| 193 Expect.isTrue(confuse(f1) is F1); | 214 Expect.isTrue(confuse(f1) is F1); |
| 194 // In checked mode, verifies the type. | 215 // In checked mode, verifies the type. |
| 195 List<Function> Function(int y, {Function x}) l1; | 216 List<Function> Function(int y, {Function x}) l1; |
| 196 // The static function f1 sets `T` to `int`. | 217 // The static function f1 sets `T` to `int`. |
| 197 if (!tIsBool) { | 218 if (!tIsBool) { |
| 198 x1 = f1 as dynamic; | 219 x1 = f1 as dynamic; |
| 199 l1 = f1 as dynamic; | 220 l1 = f1 as dynamic; |
| 200 x1 = confuse(f1); | 221 x1 = confuse(f1); |
| 201 l1 = confuse(f1); | 222 l1 = confuse(f1); |
| 202 } | 223 } |
| 203 | 224 |
| 204 Expect.isTrue(m1 is F1); | 225 Expect.isTrue(m1 is F1); |
| 205 Expect.isTrue(m1 is List<Function> Function(int y, {Function x})); | 226 Expect.isTrue(m1 is List<Function> Function(int y, {Function x})); |
| 206 Expect.isTrue(confuse(m1) is F1); | 227 Expect.isTrue(confuse(m1) is F1); |
| 207 // In checked mode, verifies the type. | 228 // In checked mode, verifies the type. |
| 208 x1 = m1; | 229 x1 = m1; |
| 209 l1 = m1; | 230 l1 = m1; |
| 210 x1 = confuse(m1); | 231 x1 = confuse(m1); |
| 211 l1 = confuse(m1); | 232 l1 = confuse(m1); |
| 212 | |
| 213 } | 233 } |
| 214 | 234 |
| 215 /// List<T> Function(int x0, {int x}) | 235 /// List<T> Function(int x0, {int x}) |
| 216 void testF2() { | 236 void testF2() { |
| 217 Expect.isTrue(f2 is F2); | 237 Expect.isTrue(f2 is F2); |
| 218 Expect.isTrue(confuse(f2) is F2); | 238 Expect.isTrue(confuse(f2) is F2); |
| 219 // In checked mode, verifies the type. | 239 // In checked mode, verifies the type. |
| 220 List<T> Function(int x0, {int x}) l2; | 240 List<T> Function(int x0, {int x}) l2; |
| 221 // The static function f2 sets `T` to `int`. | 241 // The static function f2 sets `T` to `int`. |
| 222 if (!tIsBool) { | 242 if (!tIsBool) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 236 l2 = confuse(m2); | 256 l2 = confuse(m2); |
| 237 if (!tIsBool) { | 257 if (!tIsBool) { |
| 238 Expect.isTrue(f2 is F2<int>); | 258 Expect.isTrue(f2 is F2<int>); |
| 239 Expect.isFalse(f2 is F2<bool>); | 259 Expect.isFalse(f2 is F2<bool>); |
| 240 Expect.isTrue(confuse(f2) is F2<int>); | 260 Expect.isTrue(confuse(f2) is F2<int>); |
| 241 Expect.isFalse(confuse(f2) is F2<bool>); | 261 Expect.isFalse(confuse(f2) is F2<bool>); |
| 242 Expect.equals(tIsDynamic, m2 is F2<bool>); | 262 Expect.equals(tIsDynamic, m2 is F2<bool>); |
| 243 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); | 263 Expect.equals(tIsDynamic, confuse(m2) is F2<bool>); |
| 244 } else { | 264 } else { |
| 245 if (inCheckedMode) { | 265 if (inCheckedMode) { |
| 246 Expect.throws(() { x2 = (f2 as dynamic); }); | 266 Expect.throws(() { |
| 247 Expect.throws(() { x2 = confuse(f2); }); | 267 x2 = (f2 as dynamic); |
| 268 }); |
| 269 Expect.throws(() { |
| 270 x2 = confuse(f2); |
| 271 }); |
| 248 List<T> Function(int x0, {int x}) l2; | 272 List<T> Function(int x0, {int x}) l2; |
| 249 Expect.throws(() { l2 = (f2 as dynamic); }); | 273 Expect.throws(() { |
| 250 Expect.throws(() { l2 = confuse(f2); }); | 274 l2 = (f2 as dynamic); |
| 275 }); |
| 276 Expect.throws(() { |
| 277 l2 = confuse(f2); |
| 278 }); |
| 251 } | 279 } |
| 252 List<T> Function(int x0, {int x}) l2 = m2; | 280 List<T> Function(int x0, {int x}) l2 = m2; |
| 253 // In checked mode, verifies the type. | 281 // In checked mode, verifies the type. |
| 254 x2 = m2; | 282 x2 = m2; |
| 255 x2 = confuse(m2); | 283 x2 = confuse(m2); |
| 256 } | 284 } |
| 257 } | 285 } |
| 258 | 286 |
| 259 /// Function(int x0, {List<T> x}) | 287 /// Function(int x0, {List<T> x}) |
| 260 void testF3() { | 288 void testF3() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 280 l3 = confuse(m3); | 308 l3 = confuse(m3); |
| 281 if (!tIsBool) { | 309 if (!tIsBool) { |
| 282 Expect.isTrue(f3 is F3<int>); | 310 Expect.isTrue(f3 is F3<int>); |
| 283 Expect.isFalse(f3 is F3<bool>); | 311 Expect.isFalse(f3 is F3<bool>); |
| 284 Expect.isTrue(confuse(f3) is F3<int>); | 312 Expect.isTrue(confuse(f3) is F3<int>); |
| 285 Expect.isFalse(confuse(f3) is F3<bool>); | 313 Expect.isFalse(confuse(f3) is F3<bool>); |
| 286 Expect.equals(tIsDynamic, m3 is F3<bool>); | 314 Expect.equals(tIsDynamic, m3 is F3<bool>); |
| 287 Expect.equals(tIsDynamic, confuse(m3) is F3<bool>); | 315 Expect.equals(tIsDynamic, confuse(m3) is F3<bool>); |
| 288 } else { | 316 } else { |
| 289 if (inCheckedMode) { | 317 if (inCheckedMode) { |
| 290 Expect.throws(() { x3 = (f3 as dynamic); }); | 318 Expect.throws(() { |
| 291 Expect.throws(() { x3 = confuse(f3); }); | 319 x3 = (f3 as dynamic); |
| 320 }); |
| 321 Expect.throws(() { |
| 322 x3 = confuse(f3); |
| 323 }); |
| 292 Function(int x0, {List<T> x}) l3; | 324 Function(int x0, {List<T> x}) l3; |
| 293 Expect.throws(() { l3 = (f3 as dynamic); }); | 325 Expect.throws(() { |
| 294 Expect.throws(() { l3 = confuse(f3); }); | 326 l3 = (f3 as dynamic); |
| 327 }); |
| 328 Expect.throws(() { |
| 329 l3 = confuse(f3); |
| 330 }); |
| 295 } | 331 } |
| 296 Function(int x0, {List<T> x}) l3 = m3; | 332 Function(int x0, {List<T> x}) l3 = m3; |
| 297 // In checked mode, verifies the type. | 333 // In checked mode, verifies the type. |
| 298 x3 = m3; | 334 x3 = m3; |
| 299 x3 = confuse(m3); | 335 x3 = confuse(m3); |
| 300 } | 336 } |
| 301 } | 337 } |
| 302 | 338 |
| 303 /// Function<A>(Function x) | 339 /// Function<A>(Function x) |
| 304 void testF4() { | 340 void testF4() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 315 } | 351 } |
| 316 | 352 |
| 317 Expect.isTrue(m4 is F4); | 353 Expect.isTrue(m4 is F4); |
| 318 Expect.isTrue(m4 is Function<A>(Function x)); | 354 Expect.isTrue(m4 is Function<A>(Function x)); |
| 319 Expect.isTrue(confuse(m4) is F4); | 355 Expect.isTrue(confuse(m4) is F4); |
| 320 // In checked mode, verifies the type. | 356 // In checked mode, verifies the type. |
| 321 x4 = m4; | 357 x4 = m4; |
| 322 l4 = m4; | 358 l4 = m4; |
| 323 x4 = confuse(m4); | 359 x4 = confuse(m4); |
| 324 l4 = confuse(m4); | 360 l4 = confuse(m4); |
| 325 | |
| 326 } | 361 } |
| 327 | 362 |
| 328 /// int Function(int x2, [Function x3]) Function(int x) | 363 /// int Function(int x2, [Function x3]) Function(int x) |
| 329 void testF5() { | 364 void testF5() { |
| 330 Expect.isTrue(f5 is F5); | 365 Expect.isTrue(f5 is F5); |
| 331 Expect.isTrue(confuse(f5) is F5); | 366 Expect.isTrue(confuse(f5) is F5); |
| 332 // In checked mode, verifies the type. | 367 // In checked mode, verifies the type. |
| 333 int Function(int x2, [Function x3]) Function(int x) l5; | 368 int Function(int x2, [Function x3]) Function(int x) l5; |
| 334 // The static function f5 sets `T` to `int`. | 369 // The static function f5 sets `T` to `int`. |
| 335 if (!tIsBool) { | 370 if (!tIsBool) { |
| 336 x5 = f5 as dynamic; | 371 x5 = f5 as dynamic; |
| 337 l5 = f5 as dynamic; | 372 l5 = f5 as dynamic; |
| 338 x5 = confuse(f5); | 373 x5 = confuse(f5); |
| 339 l5 = confuse(f5); | 374 l5 = confuse(f5); |
| 340 } | 375 } |
| 341 | 376 |
| 342 Expect.isTrue(m5 is F5); | 377 Expect.isTrue(m5 is F5); |
| 343 Expect.isTrue(m5 is int Function(int x2, [Function x3]) Function(int x)); | 378 Expect.isTrue(m5 is int Function(int x2, [Function x3]) Function(int x)); |
| 344 Expect.isTrue(confuse(m5) is F5); | 379 Expect.isTrue(confuse(m5) is F5); |
| 345 // In checked mode, verifies the type. | 380 // In checked mode, verifies the type. |
| 346 x5 = m5; | 381 x5 = m5; |
| 347 l5 = m5; | 382 l5 = m5; |
| 348 x5 = confuse(m5); | 383 x5 = confuse(m5); |
| 349 l5 = confuse(m5); | 384 l5 = confuse(m5); |
| 350 | |
| 351 } | 385 } |
| 352 | 386 |
| 353 /// int Function(int x1, {core.List<core.int> x}) Function(int x) | 387 /// int Function(int x1, {core.List<core.int> x}) Function(int x) |
| 354 void testF6() { | 388 void testF6() { |
| 355 Expect.isTrue(f6 is F6); | 389 Expect.isTrue(f6 is F6); |
| 356 Expect.isTrue(confuse(f6) is F6); | 390 Expect.isTrue(confuse(f6) is F6); |
| 357 // In checked mode, verifies the type. | 391 // In checked mode, verifies the type. |
| 358 int Function(int x1, {core.List<core.int> x}) Function(int x) l6; | 392 int Function(int x1, {core.List<core.int> x}) Function(int x) l6; |
| 359 // The static function f6 sets `T` to `int`. | 393 // The static function f6 sets `T` to `int`. |
| 360 if (!tIsBool) { | 394 if (!tIsBool) { |
| 361 x6 = f6 as dynamic; | 395 x6 = f6 as dynamic; |
| 362 l6 = f6 as dynamic; | 396 l6 = f6 as dynamic; |
| 363 x6 = confuse(f6); | 397 x6 = confuse(f6); |
| 364 l6 = confuse(f6); | 398 l6 = confuse(f6); |
| 365 } | 399 } |
| 366 | 400 |
| 367 Expect.isTrue(m6 is F6); | 401 Expect.isTrue(m6 is F6); |
| 368 Expect.isTrue(m6 is int Function(int x1, {core.List<core.int> x}) Function(i
nt x)); | 402 Expect.isTrue( |
| 403 m6 is int Function(int x1, {core.List<core.int> x}) Function(int x)); |
| 369 Expect.isTrue(confuse(m6) is F6); | 404 Expect.isTrue(confuse(m6) is F6); |
| 370 // In checked mode, verifies the type. | 405 // In checked mode, verifies the type. |
| 371 x6 = m6; | 406 x6 = m6; |
| 372 l6 = m6; | 407 l6 = m6; |
| 373 x6 = confuse(m6); | 408 x6 = confuse(m6); |
| 374 l6 = confuse(m6); | 409 l6 = confuse(m6); |
| 375 | |
| 376 } | 410 } |
| 377 | 411 |
| 378 /// Function Function(Function x) Function(int x) | 412 /// Function Function(Function x) Function(int x) |
| 379 void testF7() { | 413 void testF7() { |
| 380 Expect.isTrue(f7 is F7); | 414 Expect.isTrue(f7 is F7); |
| 381 Expect.isTrue(confuse(f7) is F7); | 415 Expect.isTrue(confuse(f7) is F7); |
| 382 // In checked mode, verifies the type. | 416 // In checked mode, verifies the type. |
| 383 Function Function(Function x) Function(int x) l7; | 417 Function Function(Function x) Function(int x) l7; |
| 384 // The static function f7 sets `T` to `int`. | 418 // The static function f7 sets `T` to `int`. |
| 385 if (!tIsBool) { | 419 if (!tIsBool) { |
| 386 x7 = f7 as dynamic; | 420 x7 = f7 as dynamic; |
| 387 l7 = f7 as dynamic; | 421 l7 = f7 as dynamic; |
| 388 x7 = confuse(f7); | 422 x7 = confuse(f7); |
| 389 l7 = confuse(f7); | 423 l7 = confuse(f7); |
| 390 } | 424 } |
| 391 | 425 |
| 392 Expect.isTrue(m7 is F7); | 426 Expect.isTrue(m7 is F7); |
| 393 Expect.isTrue(m7 is Function Function(Function x) Function(int x)); | 427 Expect.isTrue(m7 is Function Function(Function x) Function(int x)); |
| 394 Expect.isTrue(confuse(m7) is F7); | 428 Expect.isTrue(confuse(m7) is F7); |
| 395 // In checked mode, verifies the type. | 429 // In checked mode, verifies the type. |
| 396 x7 = m7; | 430 x7 = m7; |
| 397 l7 = m7; | 431 l7 = m7; |
| 398 x7 = confuse(m7); | 432 x7 = confuse(m7); |
| 399 l7 = confuse(m7); | 433 l7 = confuse(m7); |
| 400 | |
| 401 } | 434 } |
| 402 | 435 |
| 403 /// Function Function(int y, [core.List<core.int> x]) Function(int x) | 436 /// Function Function(int y, [core.List<core.int> x]) Function(int x) |
| 404 void testF8() { | 437 void testF8() { |
| 405 Expect.isTrue(f8 is F8); | 438 Expect.isTrue(f8 is F8); |
| 406 Expect.isTrue(confuse(f8) is F8); | 439 Expect.isTrue(confuse(f8) is F8); |
| 407 // In checked mode, verifies the type. | 440 // In checked mode, verifies the type. |
| 408 Function Function(int y, [core.List<core.int> x]) Function(int x) l8; | 441 Function Function(int y, [core.List<core.int> x]) Function(int x) l8; |
| 409 // The static function f8 sets `T` to `int`. | 442 // The static function f8 sets `T` to `int`. |
| 410 if (!tIsBool) { | 443 if (!tIsBool) { |
| 411 x8 = f8 as dynamic; | 444 x8 = f8 as dynamic; |
| 412 l8 = f8 as dynamic; | 445 l8 = f8 as dynamic; |
| 413 x8 = confuse(f8); | 446 x8 = confuse(f8); |
| 414 l8 = confuse(f8); | 447 l8 = confuse(f8); |
| 415 } | 448 } |
| 416 | 449 |
| 417 Expect.isTrue(m8 is F8); | 450 Expect.isTrue(m8 is F8); |
| 418 Expect.isTrue(m8 is Function Function(int y, [core.List<core.int> x]) Functi
on(int x)); | 451 Expect.isTrue(m8 is Function Function(int y, |
| 452 [core.List<core.int> x]) Function(int x)); |
| 419 Expect.isTrue(confuse(m8) is F8); | 453 Expect.isTrue(confuse(m8) is F8); |
| 420 // In checked mode, verifies the type. | 454 // In checked mode, verifies the type. |
| 421 x8 = m8; | 455 x8 = m8; |
| 422 l8 = m8; | 456 l8 = m8; |
| 423 x8 = confuse(m8); | 457 x8 = confuse(m8); |
| 424 l8 = confuse(m8); | 458 l8 = confuse(m8); |
| 425 | |
| 426 } | 459 } |
| 427 | 460 |
| 428 /// List<Function> Function([int x1]) Function(int x) | 461 /// List<Function> Function([int x1]) Function(int x) |
| 429 void testF9() { | 462 void testF9() { |
| 430 Expect.isTrue(f9 is F9); | 463 Expect.isTrue(f9 is F9); |
| 431 Expect.isTrue(confuse(f9) is F9); | 464 Expect.isTrue(confuse(f9) is F9); |
| 432 // In checked mode, verifies the type. | 465 // In checked mode, verifies the type. |
| 433 List<Function> Function([int x1]) Function(int x) l9; | 466 List<Function> Function([int x1]) Function(int x) l9; |
| 434 // The static function f9 sets `T` to `int`. | 467 // The static function f9 sets `T` to `int`. |
| 435 if (!tIsBool) { | 468 if (!tIsBool) { |
| 436 x9 = f9 as dynamic; | 469 x9 = f9 as dynamic; |
| 437 l9 = f9 as dynamic; | 470 l9 = f9 as dynamic; |
| 438 x9 = confuse(f9); | 471 x9 = confuse(f9); |
| 439 l9 = confuse(f9); | 472 l9 = confuse(f9); |
| 440 } | 473 } |
| 441 | 474 |
| 442 Expect.isTrue(m9 is F9); | 475 Expect.isTrue(m9 is F9); |
| 443 Expect.isTrue(m9 is List<Function> Function([int x1]) Function(int x)); | 476 Expect.isTrue(m9 is List<Function> Function([int x1]) Function(int x)); |
| 444 Expect.isTrue(confuse(m9) is F9); | 477 Expect.isTrue(confuse(m9) is F9); |
| 445 // In checked mode, verifies the type. | 478 // In checked mode, verifies the type. |
| 446 x9 = m9; | 479 x9 = m9; |
| 447 l9 = m9; | 480 l9 = m9; |
| 448 x9 = confuse(m9); | 481 x9 = confuse(m9); |
| 449 l9 = confuse(m9); | 482 l9 = confuse(m9); |
| 450 | |
| 451 } | 483 } |
| 452 | 484 |
| 453 /// List<Function> Function({List<Function> x}) Function(int x) | 485 /// List<Function> Function({List<Function> x}) Function(int x) |
| 454 void testF10() { | 486 void testF10() { |
| 455 Expect.isTrue(f10 is F10); | 487 Expect.isTrue(f10 is F10); |
| 456 Expect.isTrue(confuse(f10) is F10); | 488 Expect.isTrue(confuse(f10) is F10); |
| 457 // In checked mode, verifies the type. | 489 // In checked mode, verifies the type. |
| 458 List<Function> Function({List<Function> x}) Function(int x) l10; | 490 List<Function> Function({List<Function> x}) Function(int x) l10; |
| 459 // The static function f10 sets `T` to `int`. | 491 // The static function f10 sets `T` to `int`. |
| 460 if (!tIsBool) { | 492 if (!tIsBool) { |
| 461 x10 = f10 as dynamic; | 493 x10 = f10 as dynamic; |
| 462 l10 = f10 as dynamic; | 494 l10 = f10 as dynamic; |
| 463 x10 = confuse(f10); | 495 x10 = confuse(f10); |
| 464 l10 = confuse(f10); | 496 l10 = confuse(f10); |
| 465 } | 497 } |
| 466 | 498 |
| 467 Expect.isTrue(m10 is F10); | 499 Expect.isTrue(m10 is F10); |
| 468 Expect.isTrue(m10 is List<Function> Function({List<Function> x}) Function(in
t x)); | 500 Expect.isTrue( |
| 501 m10 is List<Function> Function({List<Function> x}) Function(int x)); |
| 469 Expect.isTrue(confuse(m10) is F10); | 502 Expect.isTrue(confuse(m10) is F10); |
| 470 // In checked mode, verifies the type. | 503 // In checked mode, verifies the type. |
| 471 x10 = m10; | 504 x10 = m10; |
| 472 l10 = m10; | 505 l10 = m10; |
| 473 x10 = confuse(m10); | 506 x10 = confuse(m10); |
| 474 l10 = confuse(m10); | 507 l10 = confuse(m10); |
| 475 | |
| 476 } | 508 } |
| 477 | 509 |
| 478 /// List<Function> Function() Function(int x) | 510 /// List<Function> Function() Function(int x) |
| 479 void testF11() { | 511 void testF11() { |
| 480 Expect.isTrue(f11 is F11); | 512 Expect.isTrue(f11 is F11); |
| 481 Expect.isTrue(confuse(f11) is F11); | 513 Expect.isTrue(confuse(f11) is F11); |
| 482 // In checked mode, verifies the type. | 514 // In checked mode, verifies the type. |
| 483 List<Function> Function() Function(int x) l11; | 515 List<Function> Function() Function(int x) l11; |
| 484 // The static function f11 sets `T` to `int`. | 516 // The static function f11 sets `T` to `int`. |
| 485 if (!tIsBool) { | 517 if (!tIsBool) { |
| 486 x11 = f11 as dynamic; | 518 x11 = f11 as dynamic; |
| 487 l11 = f11 as dynamic; | 519 l11 = f11 as dynamic; |
| 488 x11 = confuse(f11); | 520 x11 = confuse(f11); |
| 489 l11 = confuse(f11); | 521 l11 = confuse(f11); |
| 490 } | 522 } |
| 491 | 523 |
| 492 Expect.isTrue(m11 is F11); | 524 Expect.isTrue(m11 is F11); |
| 493 Expect.isTrue(m11 is List<Function> Function() Function(int x)); | 525 Expect.isTrue(m11 is List<Function> Function() Function(int x)); |
| 494 Expect.isTrue(confuse(m11) is F11); | 526 Expect.isTrue(confuse(m11) is F11); |
| 495 // In checked mode, verifies the type. | 527 // In checked mode, verifies the type. |
| 496 x11 = m11; | 528 x11 = m11; |
| 497 l11 = m11; | 529 l11 = m11; |
| 498 x11 = confuse(m11); | 530 x11 = confuse(m11); |
| 499 l11 = confuse(m11); | 531 l11 = confuse(m11); |
| 500 | |
| 501 } | 532 } |
| 502 | 533 |
| 503 /// core.List<core.int> Function(int x1, [List<Function> x]) Function(int x) | 534 /// core.List<core.int> Function(int x1, [List<Function> x]) Function(int x) |
| 504 void testF12() { | 535 void testF12() { |
| 505 Expect.isTrue(f12 is F12); | 536 Expect.isTrue(f12 is F12); |
| 506 Expect.isTrue(confuse(f12) is F12); | 537 Expect.isTrue(confuse(f12) is F12); |
| 507 // In checked mode, verifies the type. | 538 // In checked mode, verifies the type. |
| 508 core.List<core.int> Function(int x1, [List<Function> x]) Function(int x) l12
; | 539 core.List<core.int> Function(int x1, [List<Function> x]) Function(int x) |
| 540 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 x1, [List<Function> x]
) Function(int x)); | 550 Expect.isTrue(m12 is core.List<core.int> Function(int x1, |
| 551 [List<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([List<T> x1]) Function(int x) | 560 /// core.List<core.int> Function([List<T> x1]) 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([List<T> x1]) Function(int x) l13; | 565 core.List<core.int> Function([List<T> x1]) 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([List<T> x1]) Function(int
x)); | 575 Expect.isTrue( |
| 576 m13 is core.List<core.int> Function([List<T> x1]) 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([List<T> x1]) Function(int x) l13; | 598 core.List<core.int> Function([List<T> x1]) 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([List<T> x1]) Function(int x) l13 = m13; | 606 core.List<core.int> Function([List<T> x1]) Function(int x) l13 = m13; |
| 566 // In checked mode, verifies the type. | 607 // In checked mode, verifies the type. |
| 567 x13 = m13; | 608 x13 = m13; |
| 568 x13 = confuse(m13); | 609 x13 = confuse(m13); |
| 569 } | 610 } |
| 570 } | 611 } |
| 571 | 612 |
| 572 /// List<T> Function(int x, [Function x1]) Function(int x) | 613 /// List<T> Function(int x, [Function x1]) Function(int x) |
| 573 void testF14() { | 614 void testF14() { |
| 574 Expect.isTrue(f14 is F14); | 615 Expect.isTrue(f14 is F14); |
| 575 Expect.isTrue(confuse(f14) is F14); | 616 Expect.isTrue(confuse(f14) is F14); |
| 576 // In checked mode, verifies the type. | 617 // In checked mode, verifies the type. |
| 577 List<T> Function(int x, [Function x1]) Function(int x) l14; | 618 List<T> Function(int x, [Function x1]) Function(int x) l14; |
| 578 // The static function f14 sets `T` to `int`. | 619 // The static function f14 sets `T` to `int`. |
| 579 if (!tIsBool) { | 620 if (!tIsBool) { |
| 580 x14 = f14 as dynamic; | 621 x14 = f14 as dynamic; |
| 581 l14 = f14 as dynamic; | 622 l14 = f14 as dynamic; |
| 582 x14 = confuse(f14); | 623 x14 = confuse(f14); |
| 583 l14 = confuse(f14); | 624 l14 = confuse(f14); |
| 584 } | 625 } |
| 585 | 626 |
| 586 Expect.isTrue(m14 is F14); | 627 Expect.isTrue(m14 is F14); |
| 587 Expect.isTrue(m14 is List<T> Function(int x, [Function x1]) Function(int x))
; | 628 Expect |
| 629 .isTrue(m14 is List<T> Function(int x, [Function x1]) Function(int x)); |
| 588 Expect.isTrue(confuse(m14) is F14); | 630 Expect.isTrue(confuse(m14) is F14); |
| 589 // In checked mode, verifies the type. | 631 // In checked mode, verifies the type. |
| 590 x14 = m14; | 632 x14 = m14; |
| 591 l14 = m14; | 633 l14 = m14; |
| 592 x14 = confuse(m14); | 634 x14 = confuse(m14); |
| 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(int x, [Function x1]) Function(int x) l14; | 651 List<T> Function(int x, [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(int x, [Function x1]) Function(int x) l14 = m14; | 659 List<T> Function(int x, [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 y, {core.List<core.int> x}) Function(int x) | 666 /// List<T> Function(int y, {core.List<core.int> x}) 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 y, {core.List<core.int> x}) Function(int x) l15; | 671 List<T> Function(int y, {core.List<core.int> x}) 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 y, {core.List<core.int> x}) Functi
on(int x)); | 681 Expect.isTrue(m15 is List<T> Function(int y, |
| 682 {core.List<core.int> x}) 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 y, {core.List<core.int> x}) Function(int x) l15; | 704 List<T> Function(int y, {core.List<core.int> x}) 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 y, {core.List<core.int> x}) Function(int x) l15 = m15
; | 712 List<T> Function(int y, {core.List<core.int> x}) 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([Function x]) Function(int x) | 720 /// Function([Function 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([Function x]) Function(int x) l16; | 725 Function([Function 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([Function x]) Function(int x)); | 735 Expect.isTrue(m16 is Function([Function 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> x1) Function(int x) | 744 /// Function(core.List<core.int> x1) 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> x1) Function(int x) l17; | 749 Function(core.List<core.int> x1) 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> x1) Function(int x)); | 759 Expect.isTrue(m17 is Function(core.List<core.int> x1) 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 x2, [int x3]) Function(int x) | 768 /// void Function(int x2, [int x3]) 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 x2, [int x3]) Function(int x) l18; | 773 void Function(int x2, [int x3]) 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 x2, [int x3]) Function(int x)); | 783 Expect.isTrue(m18 is void Function(int x2, [int x3]) 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 x1, {List<Function> x}) Function(int x) | 792 /// void Function(int x1, {List<Function> x}) 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 x1, {List<Function> x}) Function(int x) l19; | 797 void Function(int x1, {List<Function> x}) 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 x1, {List<Function> x}) Function(int
x)); | 807 Expect.isTrue( |
| 808 m19 is void Function(int x1, {List<Function> x}) 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 /// int Function<A>(int x) Function(int x) | 817 /// int Function<A>(int 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 int Function<A>(int x) Function(int x) l20; | 822 int Function<A>(int 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) { |
| 768 x20 = f20 as dynamic; | 825 x20 = f20 as dynamic; |
| 769 l20 = f20 as dynamic; | 826 l20 = f20 as dynamic; |
| 770 x20 = confuse(f20); | 827 x20 = confuse(f20); |
| 771 l20 = confuse(f20); | 828 l20 = confuse(f20); |
| 772 } | 829 } |
| 773 | 830 |
| 774 Expect.isTrue(m20 is F20); | 831 Expect.isTrue(m20 is F20); |
| 775 Expect.isTrue(m20 is int Function<A>(int x) Function(int x)); | 832 Expect.isTrue(m20 is int Function<A>(int x) Function(int x)); |
| 776 Expect.isTrue(confuse(m20) is F20); | 833 Expect.isTrue(confuse(m20) is F20); |
| 777 // In checked mode, verifies the type. | 834 // In checked mode, verifies the type. |
| 778 x20 = m20; | 835 x20 = m20; |
| 779 l20 = m20; | 836 l20 = m20; |
| 780 x20 = confuse(m20); | 837 x20 = confuse(m20); |
| 781 l20 = confuse(m20); | 838 l20 = confuse(m20); |
| 782 | |
| 783 } | 839 } |
| 784 | 840 |
| 785 /// core.List<core.int> Function<A>(Function x) Function(int x) | 841 /// core.List<core.int> Function<A>(Function x) Function(int x) |
| 786 void testF21() { | 842 void testF21() { |
| 787 Expect.isTrue(f21 is F21); | 843 Expect.isTrue(f21 is F21); |
| 788 Expect.isTrue(confuse(f21) is F21); | 844 Expect.isTrue(confuse(f21) is F21); |
| 789 // In checked mode, verifies the type. | 845 // In checked mode, verifies the type. |
| 790 core.List<core.int> Function<A>(Function x) Function(int x) l21; | 846 core.List<core.int> Function<A>(Function x) Function(int x) l21; |
| 791 // The static function f21 sets `T` to `int`. | 847 // The static function f21 sets `T` to `int`. |
| 792 if (!tIsBool) { | 848 if (!tIsBool) { |
| 793 x21 = f21 as dynamic; | 849 x21 = f21 as dynamic; |
| 794 l21 = f21 as dynamic; | 850 l21 = f21 as dynamic; |
| 795 x21 = confuse(f21); | 851 x21 = confuse(f21); |
| 796 l21 = confuse(f21); | 852 l21 = confuse(f21); |
| 797 } | 853 } |
| 798 | 854 |
| 799 Expect.isTrue(m21 is F21); | 855 Expect.isTrue(m21 is F21); |
| 800 Expect.isTrue(m21 is core.List<core.int> Function<A>(Function x) Function(in
t x)); | 856 Expect.isTrue( |
| 857 m21 is core.List<core.int> Function<A>(Function x) Function(int x)); |
| 801 Expect.isTrue(confuse(m21) is F21); | 858 Expect.isTrue(confuse(m21) is F21); |
| 802 // In checked mode, verifies the type. | 859 // In checked mode, verifies the type. |
| 803 x21 = m21; | 860 x21 = m21; |
| 804 l21 = m21; | 861 l21 = m21; |
| 805 x21 = confuse(m21); | 862 x21 = confuse(m21); |
| 806 l21 = confuse(m21); | 863 l21 = confuse(m21); |
| 807 | |
| 808 } | 864 } |
| 809 | 865 |
| 810 /// A Function<A>(List<Function> x) Function(int x) | 866 /// A Function<A>(List<Function> x) Function(int x) |
| 811 void testF22() { | 867 void testF22() { |
| 812 Expect.isTrue(f22 is F22); | 868 Expect.isTrue(f22 is F22); |
| 813 Expect.isTrue(confuse(f22) is F22); | 869 Expect.isTrue(confuse(f22) is F22); |
| 814 // In checked mode, verifies the type. | 870 // In checked mode, verifies the type. |
| 815 A Function<A>(List<Function> x) Function(int x) l22; | 871 A Function<A>(List<Function> x) Function(int x) l22; |
| 816 // The static function f22 sets `T` to `int`. | 872 // The static function f22 sets `T` to `int`. |
| 817 if (!tIsBool) { | 873 if (!tIsBool) { |
| 818 x22 = f22 as dynamic; | 874 x22 = f22 as dynamic; |
| 819 l22 = f22 as dynamic; | 875 l22 = f22 as dynamic; |
| 820 x22 = confuse(f22); | 876 x22 = confuse(f22); |
| 821 l22 = confuse(f22); | 877 l22 = confuse(f22); |
| 822 } | 878 } |
| 823 | 879 |
| 824 Expect.isTrue(m22 is F22); | 880 Expect.isTrue(m22 is F22); |
| 825 Expect.isTrue(m22 is A Function<A>(List<Function> x) Function(int x)); | 881 Expect.isTrue(m22 is A Function<A>(List<Function> x) Function(int x)); |
| 826 Expect.isTrue(confuse(m22) is F22); | 882 Expect.isTrue(confuse(m22) is F22); |
| 827 // In checked mode, verifies the type. | 883 // In checked mode, verifies the type. |
| 828 x22 = m22; | 884 x22 = m22; |
| 829 l22 = m22; | 885 l22 = m22; |
| 830 x22 = confuse(m22); | 886 x22 = confuse(m22); |
| 831 l22 = confuse(m22); | 887 l22 = confuse(m22); |
| 832 | |
| 833 } | 888 } |
| 834 | 889 |
| 835 /// B Function(B x) Function<B extends core.int>(int x) | 890 /// B Function(B x) Function<B extends core.int>(int x) |
| 836 void testF23() { | 891 void testF23() { |
| 837 Expect.isTrue(f23 is F23); | 892 Expect.isTrue(f23 is F23); |
| 838 Expect.isTrue(confuse(f23) is F23); | 893 Expect.isTrue(confuse(f23) is F23); |
| 839 // In checked mode, verifies the type. | 894 // In checked mode, verifies the type. |
| 840 B Function(B x) Function<B extends core.int>(int x) l23; | 895 B Function(B x) Function<B extends core.int>(int x) l23; |
| 841 // The static function f23 sets `T` to `int`. | 896 // The static function f23 sets `T` to `int`. |
| 842 if (!tIsBool) { | 897 if (!tIsBool) { |
| 843 x23 = f23 as dynamic; | 898 x23 = f23 as dynamic; |
| 844 l23 = f23 as dynamic; | 899 l23 = f23 as dynamic; |
| 845 x23 = confuse(f23); | 900 x23 = confuse(f23); |
| 846 l23 = confuse(f23); | 901 l23 = confuse(f23); |
| 847 } | 902 } |
| 848 | 903 |
| 849 Expect.isTrue(m23 is F23); | 904 Expect.isTrue(m23 is F23); |
| 850 Expect.isTrue(m23 is B Function(B x) Function<B extends core.int>(int x)); | 905 Expect.isTrue(m23 is B Function(B x) Function<B extends core.int>(int x)); |
| 851 Expect.isTrue(confuse(m23) is F23); | 906 Expect.isTrue(confuse(m23) is F23); |
| 852 // In checked mode, verifies the type. | 907 // In checked mode, verifies the type. |
| 853 x23 = m23; | 908 x23 = m23; |
| 854 l23 = m23; | 909 l23 = m23; |
| 855 x23 = confuse(m23); | 910 x23 = confuse(m23); |
| 856 l23 = confuse(m23); | 911 l23 = confuse(m23); |
| 857 | |
| 858 } | 912 } |
| 859 | |
| 860 | |
| 861 } | 913 } |
| 862 | 914 |
| 863 void main() { | 915 void main() { |
| 864 new U33().runTests(); | 916 new U33().runTests(); |
| 865 new U33<int>(tIsInt: true).runTests(); | 917 new U33<int>(tIsInt: true).runTests(); |
| 866 new U33<bool>(tIsBool: true).runTests(); | 918 new U33<bool>(tIsBool: true).runTests(); |
| 867 } | 919 } |
| 868 | |
| OLD | NEW |