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