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