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