| 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> x]); | 29 = int Function([List<T> x]); |
| 27 typedef F1<T> = List<Function> Function(core.List<core.int> x); | 30 typedef F1<T> |
| 28 typedef F2<T> = List<T> Function(int y, {Function x}); | 31 = List<Function> Function(core.List<core.int> x); |
| 29 typedef F3<T> = void Function(int x0, {int x}); | 32 typedef F2<T> |
| 30 typedef F4<T> = A Function<A>(); | 33 = List<T> Function(int y, {Function x}); |
| 31 typedef F5<T> = int Function(int x1, {Function x}) Function(int x); | 34 typedef F3<T> |
| 32 typedef F6<T> = int Function([List<T> x]) Function(int x); | 35 = void Function(int x0, {int x}); |
| 33 typedef F7<T> = Function Function(int y, [Function x]) Function(int x); | 36 typedef F4<T> |
| 34 typedef F8<T> = Function Function(int x2, [core.List<core.int> x3]) Function(int
x); | 37 = A Function<A>(); |
| 35 typedef F9<T> = List<Function> Function({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 x1, {Function x}) Function(int x); |
| 37 typedef F11<T> = core.List<core.int> Function(int x1, [int x]) Function(int x); | 40 typedef F6<T> |
| 38 typedef F12<T> = core.List<core.int> Function([List<Function> x1]) Function(int
x); | 41 = int Function([List<T> x]) Function(int x); |
| 39 typedef F13<T> = core.List<core.int> Function({List<T> x}) Function(int x); | 42 typedef F7<T> |
| 40 typedef F14<T> = List<T> Function(int y, {Function x}) Function(int x); | 43 = Function Function(int y, [Function x]) Function(int x); |
| 41 typedef F15<T> = List<T> Function(int x1, [List<T> x]) Function(int x); | 44 typedef F8<T> |
| 42 typedef F16<T> = Function(Function x1) Function(int x); | 45 = Function Function(int x2, [core.List<core.int> x3]) Function(int x); |
| 43 typedef F17<T> = Function(int x, [core.List<core.int> x1]) Function(int x); | 46 typedef F9<T> |
| 44 typedef F18<T> = void Function(int x1, {int x}) Function(int x); | 47 = List<Function> Function({int x}) Function(int x); |
| 45 typedef F19<T> = void Function([core.List<core.int> x]) Function(int x); | 48 typedef F10<T> |
| 46 typedef F20<T> = int Function<A>(core.List<core.int> 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>(List<T> x) Function(int x); | 50 typedef F11<T> |
| 48 typedef F22<T> = A Function<A>() Function(int x); | 51 = core.List<core.int> Function(int x1, [int x]) Function(int x); |
| 49 typedef F23<T> = B Function(core.List<core.int> x) Function<B extends core.int>(
int x); | 52 typedef F12<T> |
| 50 | 53 = core.List<core.int> Function([List<Function> x1]) Function(int x); |
| 54 typedef F13<T> |
| 55 = core.List<core.int> Function({List<T> x}) Function(int x); |
| 56 typedef F14<T> |
| 57 = List<T> Function(int y, {Function x}) Function(int x); |
| 58 typedef F15<T> |
| 59 = List<T> Function(int x1, [List<T> x]) Function(int x); |
| 60 typedef F16<T> |
| 61 = Function(Function x1) Function(int x); |
| 62 typedef F17<T> |
| 63 = Function(int x, [core.List<core.int> x1]) Function(int x); |
| 64 typedef F18<T> |
| 65 = void Function(int x1, {int x}) Function(int x); |
| 66 typedef F19<T> |
| 67 = void Function([core.List<core.int> x]) Function(int x); |
| 68 typedef F20<T> |
| 69 = int Function<A>(core.List<core.int> x) Function(int x); |
| 70 typedef F21<T> |
| 71 = core.List<core.int> Function<A>(List<T> x) Function(int x); |
| 72 typedef F22<T> |
| 73 = A Function<A>() Function(int x); |
| 74 typedef F23<T> |
| 75 = B Function(core.List<core.int> x) Function<B extends core.int>(int x); |
| 51 | 76 |
| 52 int f0([List<int> x]) => null; | 77 int f0([List<int> x]) => null; |
| 53 List<Function> f1(core.List<core.int> x) => null; | 78 List<Function> f1(core.List<core.int> x) => null; |
| 54 List<int> f2(int y, {Function x}) => null; | 79 List<int> f2(int y, {Function x}) => null; |
| 55 void f3(int x0, {int x}) => null; | 80 void f3(int x0, {int x}) => null; |
| 56 A f4<A>() => null; | 81 A f4<A>() => null; |
| 57 int Function(int x0, {Function x}) f5(int x) => null; | 82 int Function(int x0, {Function x}) f5(int x) => null; |
| 58 int Function([List<int> x]) f6(int x) => null; | 83 int Function([List<int> x]) f6(int x) => null; |
| 59 Function Function(int y, [Function x]) f7(int x) => null; | 84 Function Function(int y, [Function x]) f7(int x) => null; |
| 60 Function Function(int x0, [core.List<core.int> x1]) f8(int x) => null; | 85 Function Function(int x0, [core.List<core.int> x1]) f8(int x) => null; |
| 61 List<Function> Function({int x}) f9(int x) => null; | 86 List<Function> Function({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 x0, [int x]) f11(int x) => null; | 88 core.List<core.int> Function(int x0, [int x]) f11(int x) => null; |
| 64 core.List<core.int> Function([List<Function> x0]) f12(int x) => null; | 89 core.List<core.int> Function([List<Function> x0]) f12(int x) => null; |
| 65 core.List<core.int> Function({List<int> x}) f13(int x) => null; | 90 core.List<core.int> Function({List<int> x}) f13(int x) => null; |
| 66 List<int> Function(int y, {Function x}) f14(int x) => null; | 91 List<int> Function(int y, {Function x}) f14(int x) => null; |
| 67 List<int> Function(int x0, [List<int> x]) f15(int x) => null; | 92 List<int> Function(int x0, [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(int x, [core.List<core.int> x0]) f17(int x) => null; | 94 Function(int x, [core.List<core.int> x0]) f17(int x) => null; |
| 70 void Function(int x0, {int x}) f18(int x) => null; | 95 void Function(int x0, {int x}) f18(int x) => null; |
| 71 void Function([core.List<core.int> x]) f19(int x) => null; | 96 void Function([core.List<core.int> x]) f19(int x) => null; |
| 72 int Function<A>(core.List<core.int> x) f20(int x) => null; | 97 int Function<A>(core.List<core.int> x) f20(int x) => null; |
| 73 core.List<core.int> Function<A>(List<int> x) f21(int x) => null; | 98 core.List<core.int> Function<A>(List<int> x) f21(int x) => null; |
| 74 A Function<A>() f22(int x) => null; | 99 A Function<A>() f22(int x) => null; |
| 75 B Function(core.List<core.int> x) f23<B extends core.int>(int x) => null; | 100 B Function(core.List<core.int> x) f23<B extends core.int>(int x) => null; |
| 76 | 101 |
| 77 | |
| 78 class U45<T> { | 102 class U45<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> x]) x0; | 107 int Function([List<T> x]) x0; |
| 84 List<Function> Function(core.List<core.int> x) x1; | 108 List<Function> Function(core.List<core.int> x) x1; |
| 85 List<T> Function(int y, {Function x}) x2; | 109 List<T> Function(int y, {Function x}) x2; |
| 86 void Function(int x0, {int x}) x3; | 110 void Function(int x0, {int x}) x3; |
| 87 A Function<A>() x4; | 111 A Function<A>() x4; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 98 List<T> Function(int x1, [List<T> x]) Function(int x) x15; | 122 List<T> Function(int x1, [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(int x, [core.List<core.int> x1]) Function(int x) x17; | 124 Function(int x, [core.List<core.int> x1]) Function(int x) x17; |
| 101 void Function(int x1, {int x}) Function(int x) x18; | 125 void Function(int x1, {int x}) Function(int x) x18; |
| 102 void Function([core.List<core.int> x]) Function(int x) x19; | 126 void Function([core.List<core.int> x]) Function(int x) x19; |
| 103 int Function<A>(core.List<core.int> x) Function(int x) x20; | 127 int Function<A>(core.List<core.int> x) Function(int x) x20; |
| 104 core.List<core.int> Function<A>(List<T> x) Function(int x) x21; | 128 core.List<core.int> Function<A>(List<T> x) Function(int x) x21; |
| 105 A Function<A>() Function(int x) x22; | 129 A Function<A>() Function(int x) x22; |
| 106 B Function(core.List<core.int> x) Function<B extends core.int>(int x) x23; | 130 B Function(core.List<core.int> x) Function<B extends core.int>(int x) x23; |
| 107 | 131 |
| 108 | |
| 109 U45({this.tIsBool: false, this.tIsInt: false}) | 132 U45({this.tIsBool: false, this.tIsInt: false}) |
| 110 : tIsDynamic = !tIsBool && !tIsInt; | 133 : tIsDynamic = !tIsBool && !tIsInt; |
| 111 | 134 |
| 112 int m0([List<T> x]) => null; | 135 int m0([List<T> x]) => null; |
| 113 List<Function> m1(core.List<core.int> x) => null; | 136 List<Function> m1(core.List<core.int> x) => null; |
| 114 List<T> m2(int y, {Function x}) => null; | 137 List<T> m2(int y, {Function x}) => null; |
| 115 void m3(int x0, {int x}) => null; | 138 void m3(int x0, {int x}) => null; |
| 116 A m4<A>() => null; | 139 A m4<A>() => null; |
| 117 int Function(int x0, {Function x}) m5(int x) => null; | 140 int Function(int x0, {Function x}) m5(int x) => null; |
| 118 int Function([List<T> x]) m6(int x) => null; | 141 int Function([List<T> x]) m6(int x) => null; |
| 119 Function Function(int y, [Function x]) m7(int x) => null; | 142 Function Function(int y, [Function x]) m7(int x) => null; |
| 120 Function Function(int x0, [core.List<core.int> x1]) m8(int x) => null; | 143 Function Function(int x0, [core.List<core.int> x1]) m8(int x) => null; |
| 121 List<Function> Function({int x}) m9(int x) => null; | 144 List<Function> Function({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 x0, [int x]) m11(int x) => null; | 146 core.List<core.int> Function(int x0, [int x]) m11(int x) => null; |
| 124 core.List<core.int> Function([List<Function> x0]) m12(int x) => null; | 147 core.List<core.int> Function([List<Function> x0]) m12(int x) => null; |
| 125 core.List<core.int> Function({List<T> x}) m13(int x) => null; | 148 core.List<core.int> Function({List<T> x}) m13(int x) => null; |
| 126 List<T> Function(int y, {Function x}) m14(int x) => null; | 149 List<T> Function(int y, {Function x}) m14(int x) => null; |
| 127 List<T> Function(int x0, [List<T> x]) m15(int x) => null; | 150 List<T> Function(int x0, [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(int x, [core.List<core.int> x0]) m17(int x) => null; | 152 Function(int x, [core.List<core.int> x0]) m17(int x) => null; |
| 130 void Function(int x0, {int x}) m18(int x) => null; | 153 void Function(int x0, {int x}) m18(int x) => null; |
| 131 void Function([core.List<core.int> x]) m19(int x) => null; | 154 void Function([core.List<core.int> x]) m19(int x) => null; |
| 132 int Function<A>(core.List<core.int> x) m20(int x) => null; | 155 int Function<A>(core.List<core.int> x) m20(int x) => null; |
| 133 core.List<core.int> Function<A>(List<T> x) m21(int x) => null; | 156 core.List<core.int> Function<A>(List<T> x) m21(int x) => null; |
| 134 A Function<A>() m22(int x) => null; | 157 A Function<A>() m22(int x) => null; |
| 135 B Function(core.List<core.int> x) m23<B extends core.int>(int x) => null; | 158 B Function(core.List<core.int> x) m23<B extends core.int>(int x) => null; |
| 136 | 159 |
| 137 | |
| 138 runTests() { | 160 runTests() { |
| 139 testF0(); | 161 testF0(); |
| 140 testF1(); | 162 testF1(); |
| 141 testF2(); | 163 testF2(); |
| 142 testF3(); | 164 testF3(); |
| 143 testF4(); | 165 testF4(); |
| 144 testF5(); | 166 testF5(); |
| 145 testF6(); | 167 testF6(); |
| 146 testF7(); | 168 testF7(); |
| 147 testF8(); | 169 testF8(); |
| (...skipping 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> x]) l0; | 224 int Function([List<T> x]) 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> x]) l0 = m0; | 232 int Function([List<T> x]) 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> x) | 239 /// List<Function> Function(core.List<core.int> x) |
| 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> x)); | 254 Expect.isTrue(m1 is List<Function> Function(core.List<core.int> x)); |
| 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, {Function x}) | 263 /// List<T> Function(int y, {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, {Function x}) l2; | 268 List<T> Function(int y, {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, {Function x}) l2; | 300 List<T> Function(int y, {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, {Function x}) l2 = m2; | 308 List<T> Function(int y, {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, {int x}) | 315 /// void Function(int x0, {int 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, {int x})); | 330 Expect.isTrue(m3 is void Function(int x0, {int 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 /// A Function<A>() | 339 /// A Function<A>() |
| 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 A Function<A>() l4; | 344 A Function<A>() 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 A Function<A>()); | 354 Expect.isTrue(m4 is A Function<A>()); |
| 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 x1, {Function x}) Function(int x) | 363 /// int Function(int x1, {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 x1, {Function x}) Function(int x) l5; | 368 int Function(int x1, {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 x1, {Function x}) Function(int x)); | 378 Expect.isTrue(m5 is int Function(int x1, {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([List<T> x]) Function(int x) | 387 /// int Function([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([List<T> x]) Function(int x) l6; | 392 int Function([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([List<T> x]) Function(int x) l6; | 424 int Function([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([List<T> x]) Function(int x) l6 = m6; | 432 int Function([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(int y, [Function x]) Function(int x) | 439 /// Function Function(int y, [Function x]) 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(int y, [Function x]) Function(int x)); | 454 Expect.isTrue(m7 is Function Function(int y, [Function x]) 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 x2, [core.List<core.int> x3]) Function(int x) | 463 /// Function Function(int x2, [core.List<core.int> x3]) 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 x2, [core.List<core.int> x3]) Function(int x) l8; | 468 Function Function(int x2, [core.List<core.int> x3]) 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 x2, [core.List<core.int> x3]) Func
tion(int x)); | 478 Expect.isTrue(m8 is Function Function(int x2, |
| 479 [core.List<core.int> x3]) 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 x}) Function(int x) | 488 /// List<Function> Function({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 x}) Function(int x) l9; | 493 List<Function> Function({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 x}) Function(int x)); | 503 Expect.isTrue(m9 is List<Function> Function({int x}) Function(int x)); |
| 463 Expect.isTrue(confuse(m9) is F9); | 504 Expect.isTrue(confuse(m9) is F9); |
| 464 // In checked mode, verifies the type. | 505 // In checked mode, verifies the type. |
| 465 x9 = m9; | 506 x9 = m9; |
| 466 l9 = m9; | 507 l9 = m9; |
| 467 x9 = confuse(m9); | 508 x9 = confuse(m9); |
| 468 l9 = confuse(m9); | 509 l9 = confuse(m9); |
| 469 | |
| 470 } | 510 } |
| 471 | 511 |
| 472 /// List<Function> Function(core.List<core.int> x) Function(int x) | 512 /// List<Function> Function(core.List<core.int> x) Function(int x) |
| 473 void testF10() { | 513 void testF10() { |
| 474 Expect.isTrue(f10 is F10); | 514 Expect.isTrue(f10 is F10); |
| 475 Expect.isTrue(confuse(f10) is F10); | 515 Expect.isTrue(confuse(f10) is F10); |
| 476 // In checked mode, verifies the type. | 516 // In checked mode, verifies the type. |
| 477 List<Function> Function(core.List<core.int> x) Function(int x) l10; | 517 List<Function> Function(core.List<core.int> x) Function(int x) l10; |
| 478 // The static function f10 sets `T` to `int`. | 518 // The static function f10 sets `T` to `int`. |
| 479 if (!tIsBool) { | 519 if (!tIsBool) { |
| 480 x10 = f10 as dynamic; | 520 x10 = f10 as dynamic; |
| 481 l10 = f10 as dynamic; | 521 l10 = f10 as dynamic; |
| 482 x10 = confuse(f10); | 522 x10 = confuse(f10); |
| 483 l10 = confuse(f10); | 523 l10 = confuse(f10); |
| 484 } | 524 } |
| 485 | 525 |
| 486 Expect.isTrue(m10 is F10); | 526 Expect.isTrue(m10 is F10); |
| 487 Expect.isTrue(m10 is List<Function> Function(core.List<core.int> x) Function
(int x)); | 527 Expect.isTrue( |
| 528 m10 is List<Function> Function(core.List<core.int> x) Function(int x)); |
| 488 Expect.isTrue(confuse(m10) is F10); | 529 Expect.isTrue(confuse(m10) is F10); |
| 489 // In checked mode, verifies the type. | 530 // In checked mode, verifies the type. |
| 490 x10 = m10; | 531 x10 = m10; |
| 491 l10 = m10; | 532 l10 = m10; |
| 492 x10 = confuse(m10); | 533 x10 = confuse(m10); |
| 493 l10 = confuse(m10); | 534 l10 = confuse(m10); |
| 494 | |
| 495 } | 535 } |
| 496 | 536 |
| 497 /// core.List<core.int> Function(int x1, [int x]) Function(int x) | 537 /// core.List<core.int> Function(int x1, [int x]) Function(int x) |
| 498 void testF11() { | 538 void testF11() { |
| 499 Expect.isTrue(f11 is F11); | 539 Expect.isTrue(f11 is F11); |
| 500 Expect.isTrue(confuse(f11) is F11); | 540 Expect.isTrue(confuse(f11) is F11); |
| 501 // In checked mode, verifies the type. | 541 // In checked mode, verifies the type. |
| 502 core.List<core.int> Function(int x1, [int x]) Function(int x) l11; | 542 core.List<core.int> Function(int x1, [int x]) Function(int x) l11; |
| 503 // The static function f11 sets `T` to `int`. | 543 // The static function f11 sets `T` to `int`. |
| 504 if (!tIsBool) { | 544 if (!tIsBool) { |
| 505 x11 = f11 as dynamic; | 545 x11 = f11 as dynamic; |
| 506 l11 = f11 as dynamic; | 546 l11 = f11 as dynamic; |
| 507 x11 = confuse(f11); | 547 x11 = confuse(f11); |
| 508 l11 = confuse(f11); | 548 l11 = confuse(f11); |
| 509 } | 549 } |
| 510 | 550 |
| 511 Expect.isTrue(m11 is F11); | 551 Expect.isTrue(m11 is F11); |
| 512 Expect.isTrue(m11 is core.List<core.int> Function(int x1, [int x]) Function(
int x)); | 552 Expect.isTrue( |
| 553 m11 is core.List<core.int> Function(int x1, [int x]) Function(int x)); |
| 513 Expect.isTrue(confuse(m11) is F11); | 554 Expect.isTrue(confuse(m11) is F11); |
| 514 // In checked mode, verifies the type. | 555 // In checked mode, verifies the type. |
| 515 x11 = m11; | 556 x11 = m11; |
| 516 l11 = m11; | 557 l11 = m11; |
| 517 x11 = confuse(m11); | 558 x11 = confuse(m11); |
| 518 l11 = confuse(m11); | 559 l11 = confuse(m11); |
| 519 | |
| 520 } | 560 } |
| 521 | 561 |
| 522 /// core.List<core.int> Function([List<Function> x1]) Function(int x) | 562 /// core.List<core.int> Function([List<Function> x1]) Function(int x) |
| 523 void testF12() { | 563 void testF12() { |
| 524 Expect.isTrue(f12 is F12); | 564 Expect.isTrue(f12 is F12); |
| 525 Expect.isTrue(confuse(f12) is F12); | 565 Expect.isTrue(confuse(f12) is F12); |
| 526 // In checked mode, verifies the type. | 566 // In checked mode, verifies the type. |
| 527 core.List<core.int> Function([List<Function> x1]) Function(int x) l12; | 567 core.List<core.int> Function([List<Function> x1]) Function(int x) l12; |
| 528 // The static function f12 sets `T` to `int`. | 568 // The static function f12 sets `T` to `int`. |
| 529 if (!tIsBool) { | 569 if (!tIsBool) { |
| 530 x12 = f12 as dynamic; | 570 x12 = f12 as dynamic; |
| 531 l12 = f12 as dynamic; | 571 l12 = f12 as dynamic; |
| 532 x12 = confuse(f12); | 572 x12 = confuse(f12); |
| 533 l12 = confuse(f12); | 573 l12 = confuse(f12); |
| 534 } | 574 } |
| 535 | 575 |
| 536 Expect.isTrue(m12 is F12); | 576 Expect.isTrue(m12 is F12); |
| 537 Expect.isTrue(m12 is core.List<core.int> Function([List<Function> x1]) Funct
ion(int x)); | 577 Expect.isTrue(m12 is core.List<core.int> Function( |
| 578 [List<Function> x1]) Function(int x)); |
| 538 Expect.isTrue(confuse(m12) is F12); | 579 Expect.isTrue(confuse(m12) is F12); |
| 539 // In checked mode, verifies the type. | 580 // In checked mode, verifies the type. |
| 540 x12 = m12; | 581 x12 = m12; |
| 541 l12 = m12; | 582 l12 = m12; |
| 542 x12 = confuse(m12); | 583 x12 = confuse(m12); |
| 543 l12 = confuse(m12); | 584 l12 = confuse(m12); |
| 544 | |
| 545 } | 585 } |
| 546 | 586 |
| 547 /// core.List<core.int> Function({List<T> x}) Function(int x) | 587 /// core.List<core.int> Function({List<T> x}) Function(int x) |
| 548 void testF13() { | 588 void testF13() { |
| 549 Expect.isTrue(f13 is F13); | 589 Expect.isTrue(f13 is F13); |
| 550 Expect.isTrue(confuse(f13) is F13); | 590 Expect.isTrue(confuse(f13) is F13); |
| 551 // In checked mode, verifies the type. | 591 // In checked mode, verifies the type. |
| 552 core.List<core.int> Function({List<T> x}) Function(int x) l13; | 592 core.List<core.int> Function({List<T> x}) Function(int x) l13; |
| 553 // The static function f13 sets `T` to `int`. | 593 // The static function f13 sets `T` to `int`. |
| 554 if (!tIsBool) { | 594 if (!tIsBool) { |
| 555 x13 = f13 as dynamic; | 595 x13 = f13 as dynamic; |
| 556 l13 = f13 as dynamic; | 596 l13 = f13 as dynamic; |
| 557 x13 = confuse(f13); | 597 x13 = confuse(f13); |
| 558 l13 = confuse(f13); | 598 l13 = confuse(f13); |
| 559 } | 599 } |
| 560 | 600 |
| 561 Expect.isTrue(m13 is F13); | 601 Expect.isTrue(m13 is F13); |
| 562 Expect.isTrue(m13 is core.List<core.int> Function({List<T> x}) Function(int
x)); | 602 Expect.isTrue( |
| 603 m13 is core.List<core.int> Function({List<T> x}) Function(int x)); |
| 563 Expect.isTrue(confuse(m13) is F13); | 604 Expect.isTrue(confuse(m13) is F13); |
| 564 // In checked mode, verifies the type. | 605 // In checked mode, verifies the type. |
| 565 x13 = m13; | 606 x13 = m13; |
| 566 l13 = m13; | 607 l13 = m13; |
| 567 x13 = confuse(m13); | 608 x13 = confuse(m13); |
| 568 l13 = confuse(m13); | 609 l13 = confuse(m13); |
| 569 if (!tIsBool) { | 610 if (!tIsBool) { |
| 570 Expect.isTrue(f13 is F13<int>); | 611 Expect.isTrue(f13 is F13<int>); |
| 571 Expect.isFalse(f13 is F13<bool>); | 612 Expect.isFalse(f13 is F13<bool>); |
| 572 Expect.isTrue(confuse(f13) is F13<int>); | 613 Expect.isTrue(confuse(f13) is F13<int>); |
| 573 Expect.isFalse(confuse(f13) is F13<bool>); | 614 Expect.isFalse(confuse(f13) is F13<bool>); |
| 574 Expect.equals(tIsDynamic, m13 is F13<bool>); | 615 Expect.equals(tIsDynamic, m13 is F13<bool>); |
| 575 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); | 616 Expect.equals(tIsDynamic, confuse(m13) is F13<bool>); |
| 576 } else { | 617 } else { |
| 577 if (inCheckedMode) { | 618 if (inCheckedMode) { |
| 578 Expect.throws(() { x13 = (f13 as dynamic); }); | 619 Expect.throws(() { |
| 579 Expect.throws(() { x13 = confuse(f13); }); | 620 x13 = (f13 as dynamic); |
| 621 }); |
| 622 Expect.throws(() { |
| 623 x13 = confuse(f13); |
| 624 }); |
| 580 core.List<core.int> Function({List<T> x}) Function(int x) l13; | 625 core.List<core.int> Function({List<T> x}) Function(int x) l13; |
| 581 Expect.throws(() { l13 = (f13 as dynamic); }); | 626 Expect.throws(() { |
| 582 Expect.throws(() { l13 = confuse(f13); }); | 627 l13 = (f13 as dynamic); |
| 628 }); |
| 629 Expect.throws(() { |
| 630 l13 = confuse(f13); |
| 631 }); |
| 583 } | 632 } |
| 584 core.List<core.int> Function({List<T> x}) Function(int x) l13 = m13; | 633 core.List<core.int> Function({List<T> x}) Function(int x) l13 = m13; |
| 585 // In checked mode, verifies the type. | 634 // In checked mode, verifies the type. |
| 586 x13 = m13; | 635 x13 = m13; |
| 587 x13 = confuse(m13); | 636 x13 = confuse(m13); |
| 588 } | 637 } |
| 589 } | 638 } |
| 590 | 639 |
| 591 /// List<T> Function(int y, {Function x}) Function(int x) | 640 /// List<T> Function(int y, {Function x}) Function(int x) |
| 592 void testF14() { | 641 void testF14() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 612 l14 = confuse(m14); | 661 l14 = confuse(m14); |
| 613 if (!tIsBool) { | 662 if (!tIsBool) { |
| 614 Expect.isTrue(f14 is F14<int>); | 663 Expect.isTrue(f14 is F14<int>); |
| 615 Expect.isFalse(f14 is F14<bool>); | 664 Expect.isFalse(f14 is F14<bool>); |
| 616 Expect.isTrue(confuse(f14) is F14<int>); | 665 Expect.isTrue(confuse(f14) is F14<int>); |
| 617 Expect.isFalse(confuse(f14) is F14<bool>); | 666 Expect.isFalse(confuse(f14) is F14<bool>); |
| 618 Expect.equals(tIsDynamic, m14 is F14<bool>); | 667 Expect.equals(tIsDynamic, m14 is F14<bool>); |
| 619 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); | 668 Expect.equals(tIsDynamic, confuse(m14) is F14<bool>); |
| 620 } else { | 669 } else { |
| 621 if (inCheckedMode) { | 670 if (inCheckedMode) { |
| 622 Expect.throws(() { x14 = (f14 as dynamic); }); | 671 Expect.throws(() { |
| 623 Expect.throws(() { x14 = confuse(f14); }); | 672 x14 = (f14 as dynamic); |
| 673 }); |
| 674 Expect.throws(() { |
| 675 x14 = confuse(f14); |
| 676 }); |
| 624 List<T> Function(int y, {Function x}) Function(int x) l14; | 677 List<T> Function(int y, {Function x}) Function(int x) l14; |
| 625 Expect.throws(() { l14 = (f14 as dynamic); }); | 678 Expect.throws(() { |
| 626 Expect.throws(() { l14 = confuse(f14); }); | 679 l14 = (f14 as dynamic); |
| 680 }); |
| 681 Expect.throws(() { |
| 682 l14 = confuse(f14); |
| 683 }); |
| 627 } | 684 } |
| 628 List<T> Function(int y, {Function x}) Function(int x) l14 = m14; | 685 List<T> Function(int y, {Function x}) Function(int x) l14 = m14; |
| 629 // In checked mode, verifies the type. | 686 // In checked mode, verifies the type. |
| 630 x14 = m14; | 687 x14 = m14; |
| 631 x14 = confuse(m14); | 688 x14 = confuse(m14); |
| 632 } | 689 } |
| 633 } | 690 } |
| 634 | 691 |
| 635 /// List<T> Function(int x1, [List<T> x]) Function(int x) | 692 /// List<T> Function(int x1, [List<T> x]) Function(int x) |
| 636 void testF15() { | 693 void testF15() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 656 l15 = confuse(m15); | 713 l15 = confuse(m15); |
| 657 if (!tIsBool) { | 714 if (!tIsBool) { |
| 658 Expect.isTrue(f15 is F15<int>); | 715 Expect.isTrue(f15 is F15<int>); |
| 659 Expect.isFalse(f15 is F15<bool>); | 716 Expect.isFalse(f15 is F15<bool>); |
| 660 Expect.isTrue(confuse(f15) is F15<int>); | 717 Expect.isTrue(confuse(f15) is F15<int>); |
| 661 Expect.isFalse(confuse(f15) is F15<bool>); | 718 Expect.isFalse(confuse(f15) is F15<bool>); |
| 662 Expect.equals(tIsDynamic, m15 is F15<bool>); | 719 Expect.equals(tIsDynamic, m15 is F15<bool>); |
| 663 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); | 720 Expect.equals(tIsDynamic, confuse(m15) is F15<bool>); |
| 664 } else { | 721 } else { |
| 665 if (inCheckedMode) { | 722 if (inCheckedMode) { |
| 666 Expect.throws(() { x15 = (f15 as dynamic); }); | 723 Expect.throws(() { |
| 667 Expect.throws(() { x15 = confuse(f15); }); | 724 x15 = (f15 as dynamic); |
| 725 }); |
| 726 Expect.throws(() { |
| 727 x15 = confuse(f15); |
| 728 }); |
| 668 List<T> Function(int x1, [List<T> x]) Function(int x) l15; | 729 List<T> Function(int x1, [List<T> x]) Function(int x) l15; |
| 669 Expect.throws(() { l15 = (f15 as dynamic); }); | 730 Expect.throws(() { |
| 670 Expect.throws(() { l15 = confuse(f15); }); | 731 l15 = (f15 as dynamic); |
| 732 }); |
| 733 Expect.throws(() { |
| 734 l15 = confuse(f15); |
| 735 }); |
| 671 } | 736 } |
| 672 List<T> Function(int x1, [List<T> x]) Function(int x) l15 = m15; | 737 List<T> Function(int x1, [List<T> x]) Function(int x) l15 = m15; |
| 673 // In checked mode, verifies the type. | 738 // In checked mode, verifies the type. |
| 674 x15 = m15; | 739 x15 = m15; |
| 675 x15 = confuse(m15); | 740 x15 = confuse(m15); |
| 676 } | 741 } |
| 677 } | 742 } |
| 678 | 743 |
| 679 /// Function(Function x1) Function(int x) | 744 /// Function(Function x1) Function(int x) |
| 680 void testF16() { | 745 void testF16() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 691 } | 756 } |
| 692 | 757 |
| 693 Expect.isTrue(m16 is F16); | 758 Expect.isTrue(m16 is F16); |
| 694 Expect.isTrue(m16 is Function(Function x1) Function(int x)); | 759 Expect.isTrue(m16 is Function(Function x1) Function(int x)); |
| 695 Expect.isTrue(confuse(m16) is F16); | 760 Expect.isTrue(confuse(m16) is F16); |
| 696 // In checked mode, verifies the type. | 761 // In checked mode, verifies the type. |
| 697 x16 = m16; | 762 x16 = m16; |
| 698 l16 = m16; | 763 l16 = m16; |
| 699 x16 = confuse(m16); | 764 x16 = confuse(m16); |
| 700 l16 = confuse(m16); | 765 l16 = confuse(m16); |
| 701 | |
| 702 } | 766 } |
| 703 | 767 |
| 704 /// Function(int x, [core.List<core.int> x1]) Function(int x) | 768 /// Function(int x, [core.List<core.int> x1]) Function(int x) |
| 705 void testF17() { | 769 void testF17() { |
| 706 Expect.isTrue(f17 is F17); | 770 Expect.isTrue(f17 is F17); |
| 707 Expect.isTrue(confuse(f17) is F17); | 771 Expect.isTrue(confuse(f17) is F17); |
| 708 // In checked mode, verifies the type. | 772 // In checked mode, verifies the type. |
| 709 Function(int x, [core.List<core.int> x1]) Function(int x) l17; | 773 Function(int x, [core.List<core.int> x1]) Function(int x) l17; |
| 710 // The static function f17 sets `T` to `int`. | 774 // The static function f17 sets `T` to `int`. |
| 711 if (!tIsBool) { | 775 if (!tIsBool) { |
| 712 x17 = f17 as dynamic; | 776 x17 = f17 as dynamic; |
| 713 l17 = f17 as dynamic; | 777 l17 = f17 as dynamic; |
| 714 x17 = confuse(f17); | 778 x17 = confuse(f17); |
| 715 l17 = confuse(f17); | 779 l17 = confuse(f17); |
| 716 } | 780 } |
| 717 | 781 |
| 718 Expect.isTrue(m17 is F17); | 782 Expect.isTrue(m17 is F17); |
| 719 Expect.isTrue(m17 is Function(int x, [core.List<core.int> x1]) Function(int
x)); | 783 Expect.isTrue( |
| 784 m17 is Function(int x, [core.List<core.int> x1]) Function(int x)); |
| 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 x1, {int x}) Function(int x) | 793 /// void Function(int x1, {int x}) Function(int x) |
| 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 x1, {int x}) Function(int x) l18; | 798 void Function(int x1, {int x}) Function(int x) 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 x1, {int x}) Function(int x)); | 808 Expect.isTrue(m18 is void Function(int x1, {int x}) Function(int x)); |
| 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([core.List<core.int> x]) Function(int x) | 817 /// void Function([core.List<core.int> x]) Function(int x) |
| 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([core.List<core.int> x]) Function(int x) l19; | 822 void Function([core.List<core.int> x]) Function(int x) 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([core.List<core.int> x]) Function(int x))
; | 832 Expect |
| 833 .isTrue(m19 is void Function([core.List<core.int> x]) Function(int x)); |
| 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>(core.List<core.int> x) Function(int x) | 842 /// int Function<A>(core.List<core.int> x) Function(int x) |
| 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>(core.List<core.int> x) Function(int x) l20; | 847 int Function<A>(core.List<core.int> x) Function(int x) 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) { |
| 787 x20 = f20 as dynamic; | 850 x20 = f20 as dynamic; |
| 788 l20 = f20 as dynamic; | 851 l20 = f20 as dynamic; |
| 789 x20 = confuse(f20); | 852 x20 = confuse(f20); |
| 790 l20 = confuse(f20); | 853 l20 = confuse(f20); |
| 791 } | 854 } |
| 792 | 855 |
| 793 Expect.isTrue(m20 is F20); | 856 Expect.isTrue(m20 is F20); |
| 794 Expect.isTrue(m20 is int Function<A>(core.List<core.int> x) Function(int x))
; | 857 Expect |
| 858 .isTrue(m20 is int Function<A>(core.List<core.int> x) Function(int x)); |
| 795 Expect.isTrue(confuse(m20) is F20); | 859 Expect.isTrue(confuse(m20) is F20); |
| 796 // In checked mode, verifies the type. | 860 // In checked mode, verifies the type. |
| 797 x20 = m20; | 861 x20 = m20; |
| 798 l20 = m20; | 862 l20 = m20; |
| 799 x20 = confuse(m20); | 863 x20 = confuse(m20); |
| 800 l20 = confuse(m20); | 864 l20 = confuse(m20); |
| 801 | |
| 802 } | 865 } |
| 803 | 866 |
| 804 /// core.List<core.int> Function<A>(List<T> x) Function(int x) | 867 /// core.List<core.int> Function<A>(List<T> x) Function(int x) |
| 805 void testF21() { | 868 void testF21() { |
| 806 Expect.isTrue(f21 is F21); | 869 Expect.isTrue(f21 is F21); |
| 807 Expect.isTrue(confuse(f21) is F21); | 870 Expect.isTrue(confuse(f21) is F21); |
| 808 // In checked mode, verifies the type. | 871 // In checked mode, verifies the type. |
| 809 core.List<core.int> Function<A>(List<T> x) Function(int x) l21; | 872 core.List<core.int> Function<A>(List<T> x) Function(int x) l21; |
| 810 // The static function f21 sets `T` to `int`. | 873 // The static function f21 sets `T` to `int`. |
| 811 if (!tIsBool) { | 874 if (!tIsBool) { |
| 812 x21 = f21 as dynamic; | 875 x21 = f21 as dynamic; |
| 813 l21 = f21 as dynamic; | 876 l21 = f21 as dynamic; |
| 814 x21 = confuse(f21); | 877 x21 = confuse(f21); |
| 815 l21 = confuse(f21); | 878 l21 = confuse(f21); |
| 816 } | 879 } |
| 817 | 880 |
| 818 Expect.isTrue(m21 is F21); | 881 Expect.isTrue(m21 is F21); |
| 819 Expect.isTrue(m21 is core.List<core.int> Function<A>(List<T> x) Function(int
x)); | 882 Expect.isTrue( |
| 883 m21 is core.List<core.int> Function<A>(List<T> x) Function(int x)); |
| 820 Expect.isTrue(confuse(m21) is F21); | 884 Expect.isTrue(confuse(m21) is F21); |
| 821 // In checked mode, verifies the type. | 885 // In checked mode, verifies the type. |
| 822 x21 = m21; | 886 x21 = m21; |
| 823 l21 = m21; | 887 l21 = m21; |
| 824 x21 = confuse(m21); | 888 x21 = confuse(m21); |
| 825 l21 = confuse(m21); | 889 l21 = confuse(m21); |
| 826 if (!tIsBool) { | 890 if (!tIsBool) { |
| 827 Expect.isTrue(f21 is F21<int>); | 891 Expect.isTrue(f21 is F21<int>); |
| 828 Expect.isFalse(f21 is F21<bool>); | 892 Expect.isFalse(f21 is F21<bool>); |
| 829 Expect.isTrue(confuse(f21) is F21<int>); | 893 Expect.isTrue(confuse(f21) is F21<int>); |
| 830 Expect.isFalse(confuse(f21) is F21<bool>); | 894 Expect.isFalse(confuse(f21) is F21<bool>); |
| 831 Expect.equals(tIsDynamic, m21 is F21<bool>); | 895 Expect.equals(tIsDynamic, m21 is F21<bool>); |
| 832 Expect.equals(tIsDynamic, confuse(m21) is F21<bool>); | 896 Expect.equals(tIsDynamic, confuse(m21) is F21<bool>); |
| 833 } else { | 897 } else { |
| 834 if (inCheckedMode) { | 898 if (inCheckedMode) { |
| 835 Expect.throws(() { x21 = (f21 as dynamic); }); | 899 Expect.throws(() { |
| 836 Expect.throws(() { x21 = confuse(f21); }); | 900 x21 = (f21 as dynamic); |
| 901 }); |
| 902 Expect.throws(() { |
| 903 x21 = confuse(f21); |
| 904 }); |
| 837 core.List<core.int> Function<A>(List<T> x) Function(int x) l21; | 905 core.List<core.int> Function<A>(List<T> x) Function(int x) l21; |
| 838 Expect.throws(() { l21 = (f21 as dynamic); }); | 906 Expect.throws(() { |
| 839 Expect.throws(() { l21 = confuse(f21); }); | 907 l21 = (f21 as dynamic); |
| 908 }); |
| 909 Expect.throws(() { |
| 910 l21 = confuse(f21); |
| 911 }); |
| 840 } | 912 } |
| 841 core.List<core.int> Function<A>(List<T> x) Function(int x) l21 = m21; | 913 core.List<core.int> Function<A>(List<T> x) Function(int x) l21 = m21; |
| 842 // In checked mode, verifies the type. | 914 // In checked mode, verifies the type. |
| 843 x21 = m21; | 915 x21 = m21; |
| 844 x21 = confuse(m21); | 916 x21 = confuse(m21); |
| 845 } | 917 } |
| 846 } | 918 } |
| 847 | 919 |
| 848 /// A Function<A>() Function(int x) | 920 /// A Function<A>() Function(int x) |
| 849 void testF22() { | 921 void testF22() { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 860 } | 932 } |
| 861 | 933 |
| 862 Expect.isTrue(m22 is F22); | 934 Expect.isTrue(m22 is F22); |
| 863 Expect.isTrue(m22 is A Function<A>() Function(int x)); | 935 Expect.isTrue(m22 is A Function<A>() 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(core.List<core.int> x) Function<B extends core.int>(int x) | 944 /// B Function(core.List<core.int> x) 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(core.List<core.int> x) Function<B extends core.int>(int x) l23; | 949 B Function(core.List<core.int> x) 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(core.List<core.int> x) Function<B extends co
re.int>(int x)); | 959 Expect.isTrue(m23 is B Function( |
| 960 core.List<core.int> x) Function<B extends core.int>(int x)); |
| 889 Expect.isTrue(confuse(m23) is F23); | 961 Expect.isTrue(confuse(m23) is F23); |
| 890 // In checked mode, verifies the type. | 962 // In checked mode, verifies the type. |
| 891 x23 = m23; | 963 x23 = m23; |
| 892 l23 = m23; | 964 l23 = m23; |
| 893 x23 = confuse(m23); | 965 x23 = confuse(m23); |
| 894 l23 = confuse(m23); | 966 l23 = confuse(m23); |
| 895 | |
| 896 } | 967 } |
| 897 | |
| 898 | |
| 899 } | 968 } |
| 900 | 969 |
| 901 void main() { | 970 void main() { |
| 902 new U45().runTests(); | 971 new U45().runTests(); |
| 903 new U45<int>(tIsInt: true).runTests(); | 972 new U45<int>(tIsInt: true).runTests(); |
| 904 new U45<bool>(tIsBool: true).runTests(); | 973 new U45<bool>(tIsBool: true).runTests(); |
| 905 } | 974 } |
| 906 | |
| OLD | NEW |