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