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