Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: tests/language/function_type/function_type22_test.dart

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

Powered by Google App Engine
This is Rietveld 408576698