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