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