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

Side by Side Diff: pkg/kernel/testcases/reify/native_types_test.dart.expect

Issue 2697873007: Merge the work on Generic Types Reification from 'dart-lang/reify' repo (Closed)
Patch Set: Get back parameter erroneously removed by previous commit Created 3 years, 10 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
(Empty)
1 library native_types;
2 import self as self;
3 import "dart:core" as core;
4 import "../../runtime/reify/interceptors.dart" as int;
5 import "../../runtime/reify/types.dart" as typ;
6 import "dart:mock" as mock;
7 import "./test_base.dart" as tes;
8 import "../../runtime/reify/declarations.dart" as dec;
9
10 abstract class C extends core::Object implements int::HasRuntimeTypeGetter {
11 constructor •() → void
12 : super core::Object::•()
13 ;
14 get $type() → typ::ReifiedType
15 return new typ::Interface::•(self::$declarations.[](0));
16 get $is$AbstractClassInstantiationError() → core::bool
17 return false;
18 get $is$NoSuchMethodError() → core::bool
19 return false;
20 get $is$CyclicInitializationError() → core::bool
21 return false;
22 get $is$RangeError() → core::bool
23 return false;
24 get $is$int() → core::bool
25 return false;
26 get $is$double() → core::bool
27 return false;
28 get $is$List() → core::bool
29 return false;
30 get $is$String() → core::bool
31 return false;
32 get $is$Object() → core::bool
33 return true;
34 get $is$bool() → core::bool
35 return false;
36 get $is$UnsupportedError() → core::bool
37 return false;
38 get $is$ArgumentError() → core::bool
39 return false;
40 get $is$IntegerDivisionByZeroException() → core::bool
41 return false;
42 }
43 class D extends core::Object implements int::HasRuntimeTypeGetter {
44 constructor •() → void
45 : super core::Object::•()
46 ;
47 get $type() → typ::ReifiedType
48 return new typ::Interface::•(self::$declarations.[](1));
49 get $is$AbstractClassInstantiationError() → core::bool
50 return false;
51 get $is$NoSuchMethodError() → core::bool
52 return false;
53 get $is$CyclicInitializationError() → core::bool
54 return false;
55 get $is$RangeError() → core::bool
56 return false;
57 get $is$int() → core::bool
58 return false;
59 get $is$double() → core::bool
60 return false;
61 get $is$List() → core::bool
62 return false;
63 get $is$String() → core::bool
64 return false;
65 get $is$Object() → core::bool
66 return true;
67 get $is$bool() → core::bool
68 return false;
69 get $is$UnsupportedError() → core::bool
70 return false;
71 get $is$ArgumentError() → core::bool
72 return false;
73 get $is$IntegerDivisionByZeroException() → core::bool
74 return false;
75 }
76 class Closure#main#function extends core::Object implements core::Function, int: :HasRuntimeTypeGetter {
77 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
78 field mock::Context context;
79 constructor •(final mock::Context context) → dynamic
80 : self::Closure#main#function::context = context
81 ;
82 method call() → dynamic {
83 "This is a temporary solution. In the VM, this will become an additional par ameter.";
84 final mock::Context #contextParameter = this.{self::Closure#main#function::c ontext};
85 return throw int::attachType(new core::AbstractClassInstantiationError::•("C "), new typ::Interface::•(self::$declarations.[](3)));
86 }
87 get $type() → typ::ReifiedType
88 return new typ::Interface::•(self::$declarations.[](2));
89 get $is$AbstractClassInstantiationError() → core::bool
90 return false;
91 get $is$NoSuchMethodError() → core::bool
92 return false;
93 get $is$CyclicInitializationError() → core::bool
94 return false;
95 get $is$RangeError() → core::bool
96 return false;
97 get $is$int() → core::bool
98 return false;
99 get $is$double() → core::bool
100 return false;
101 get $is$List() → core::bool
102 return false;
103 get $is$String() → core::bool
104 return false;
105 get $is$Object() → core::bool
106 return true;
107 get $is$bool() → core::bool
108 return false;
109 get $is$UnsupportedError() → core::bool
110 return false;
111 get $is$ArgumentError() → core::bool
112 return false;
113 get $is$IntegerDivisionByZeroException() → core::bool
114 return false;
115 }
116 class Closure#main#function#1 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
117 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
118 field mock::Context context;
119 constructor •(final mock::Context context) → dynamic
120 : self::Closure#main#function#1::context = context
121 ;
122 method call(dynamic e) → dynamic {
123 "This is a temporary solution. In the VM, this will become an additional par ameter.";
124 final mock::Context #contextParameter = this.{self::Closure#main#function#1: :context};
125 return typ::isSubtypeOf(int::type(e), new typ::Interface::•(self::$declarati ons.[](3)));
126 }
127 get $type() → typ::ReifiedType
128 return new typ::Interface::•(self::$declarations.[](4));
129 get $is$AbstractClassInstantiationError() → core::bool
130 return false;
131 get $is$NoSuchMethodError() → core::bool
132 return false;
133 get $is$CyclicInitializationError() → core::bool
134 return false;
135 get $is$RangeError() → core::bool
136 return false;
137 get $is$int() → core::bool
138 return false;
139 get $is$double() → core::bool
140 return false;
141 get $is$List() → core::bool
142 return false;
143 get $is$String() → core::bool
144 return false;
145 get $is$Object() → core::bool
146 return true;
147 get $is$bool() → core::bool
148 return false;
149 get $is$UnsupportedError() → core::bool
150 return false;
151 get $is$ArgumentError() → core::bool
152 return false;
153 get $is$IntegerDivisionByZeroException() → core::bool
154 return false;
155 }
156 class Closure#main#function#2 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
157 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
158 field mock::Context context;
159 constructor •(final mock::Context context) → dynamic
160 : self::Closure#main#function#2::context = context
161 ;
162 method call() → dynamic {
163 "This is a temporary solution. In the VM, this will become an additional par ameter.";
164 final mock::Context #contextParameter = this.{self::Closure#main#function#2: :context};
165 return new self::D::•().foo();
166 }
167 get $type() → typ::ReifiedType
168 return new typ::Interface::•(self::$declarations.[](5));
169 get $is$AbstractClassInstantiationError() → core::bool
170 return false;
171 get $is$NoSuchMethodError() → core::bool
172 return false;
173 get $is$CyclicInitializationError() → core::bool
174 return false;
175 get $is$RangeError() → core::bool
176 return false;
177 get $is$int() → core::bool
178 return false;
179 get $is$double() → core::bool
180 return false;
181 get $is$List() → core::bool
182 return false;
183 get $is$String() → core::bool
184 return false;
185 get $is$Object() → core::bool
186 return true;
187 get $is$bool() → core::bool
188 return false;
189 get $is$UnsupportedError() → core::bool
190 return false;
191 get $is$ArgumentError() → core::bool
192 return false;
193 get $is$IntegerDivisionByZeroException() → core::bool
194 return false;
195 }
196 class Closure#main#function#3 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
197 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
198 field mock::Context context;
199 constructor •(final mock::Context context) → dynamic
200 : self::Closure#main#function#3::context = context
201 ;
202 method call(dynamic e) → dynamic {
203 "This is a temporary solution. In the VM, this will become an additional par ameter.";
204 final mock::Context #contextParameter = this.{self::Closure#main#function#3: :context};
205 return typ::isSubtypeOf(int::type(e), new typ::Interface::•(self::$declarati ons.[](7)));
206 }
207 get $type() → typ::ReifiedType
208 return new typ::Interface::•(self::$declarations.[](6));
209 get $is$AbstractClassInstantiationError() → core::bool
210 return false;
211 get $is$NoSuchMethodError() → core::bool
212 return false;
213 get $is$CyclicInitializationError() → core::bool
214 return false;
215 get $is$RangeError() → core::bool
216 return false;
217 get $is$int() → core::bool
218 return false;
219 get $is$double() → core::bool
220 return false;
221 get $is$List() → core::bool
222 return false;
223 get $is$String() → core::bool
224 return false;
225 get $is$Object() → core::bool
226 return true;
227 get $is$bool() → core::bool
228 return false;
229 get $is$UnsupportedError() → core::bool
230 return false;
231 get $is$ArgumentError() → core::bool
232 return false;
233 get $is$IntegerDivisionByZeroException() → core::bool
234 return false;
235 }
236 class Closure#main#function#4 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
237 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
238 field mock::Context context;
239 constructor •(final mock::Context context) → dynamic
240 : self::Closure#main#function#4::context = context
241 ;
242 method call() → dynamic {
243 "This is a temporary solution. In the VM, this will become an additional par ameter.";
244 final mock::Context #contextParameter = this.{self::Closure#main#function#4: :context};
245 return self::foo;
246 }
247 get $type() → typ::ReifiedType
248 return new typ::Interface::•(self::$declarations.[](8));
249 get $is$AbstractClassInstantiationError() → core::bool
250 return false;
251 get $is$NoSuchMethodError() → core::bool
252 return false;
253 get $is$CyclicInitializationError() → core::bool
254 return false;
255 get $is$RangeError() → core::bool
256 return false;
257 get $is$int() → core::bool
258 return false;
259 get $is$double() → core::bool
260 return false;
261 get $is$List() → core::bool
262 return false;
263 get $is$String() → core::bool
264 return false;
265 get $is$Object() → core::bool
266 return true;
267 get $is$bool() → core::bool
268 return false;
269 get $is$UnsupportedError() → core::bool
270 return false;
271 get $is$ArgumentError() → core::bool
272 return false;
273 get $is$IntegerDivisionByZeroException() → core::bool
274 return false;
275 }
276 class Closure#main#function#5 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
277 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
278 field mock::Context context;
279 constructor •(final mock::Context context) → dynamic
280 : self::Closure#main#function#5::context = context
281 ;
282 method call(dynamic e) → dynamic {
283 "This is a temporary solution. In the VM, this will become an additional par ameter.";
284 final mock::Context #contextParameter = this.{self::Closure#main#function#5: :context};
285 return typ::isSubtypeOf(int::type(e), new typ::Interface::•(self::$declarati ons.[](10)));
286 }
287 get $type() → typ::ReifiedType
288 return new typ::Interface::•(self::$declarations.[](9));
289 get $is$AbstractClassInstantiationError() → core::bool
290 return false;
291 get $is$NoSuchMethodError() → core::bool
292 return false;
293 get $is$CyclicInitializationError() → core::bool
294 return false;
295 get $is$RangeError() → core::bool
296 return false;
297 get $is$int() → core::bool
298 return false;
299 get $is$double() → core::bool
300 return false;
301 get $is$List() → core::bool
302 return false;
303 get $is$String() → core::bool
304 return false;
305 get $is$Object() → core::bool
306 return true;
307 get $is$bool() → core::bool
308 return false;
309 get $is$UnsupportedError() → core::bool
310 return false;
311 get $is$ArgumentError() → core::bool
312 return false;
313 get $is$IntegerDivisionByZeroException() → core::bool
314 return false;
315 }
316 class Closure#main#function#6 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
317 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
318 field mock::Context context;
319 constructor •(final mock::Context context) → dynamic
320 : self::Closure#main#function#6::context = context
321 ;
322 method call() → dynamic {
323 "This is a temporary solution. In the VM, this will become an additional par ameter.";
324 final mock::Context #contextParameter = this.{self::Closure#main#function#6: :context};
325 return int::attachType(<dynamic>[], new typ::Interface::•(self::$declaration s.[](12), <dynamic>[const typ::Dynamic::•()])).[](1);
326 }
327 get $type() → typ::ReifiedType
328 return new typ::Interface::•(self::$declarations.[](11));
329 get $is$AbstractClassInstantiationError() → core::bool
330 return false;
331 get $is$NoSuchMethodError() → core::bool
332 return false;
333 get $is$CyclicInitializationError() → core::bool
334 return false;
335 get $is$RangeError() → core::bool
336 return false;
337 get $is$int() → core::bool
338 return false;
339 get $is$double() → core::bool
340 return false;
341 get $is$List() → core::bool
342 return false;
343 get $is$String() → core::bool
344 return false;
345 get $is$Object() → core::bool
346 return true;
347 get $is$bool() → core::bool
348 return false;
349 get $is$UnsupportedError() → core::bool
350 return false;
351 get $is$ArgumentError() → core::bool
352 return false;
353 get $is$IntegerDivisionByZeroException() → core::bool
354 return false;
355 }
356 class Closure#main#function#7 extends core::Object implements core::Function, in t::HasRuntimeTypeGetter {
357 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
358 field mock::Context context;
359 constructor •(final mock::Context context) → dynamic
360 : self::Closure#main#function#7::context = context
361 ;
362 method call(dynamic e) → dynamic {
363 "This is a temporary solution. In the VM, this will become an additional par ameter.";
364 final mock::Context #contextParameter = this.{self::Closure#main#function#7: :context};
365 return typ::isSubtypeOf(int::type(e), new typ::Interface::•(self::$declarati ons.[](14)));
366 }
367 get $type() → typ::ReifiedType
368 return new typ::Interface::•(self::$declarations.[](13));
369 get $is$AbstractClassInstantiationError() → core::bool
370 return false;
371 get $is$NoSuchMethodError() → core::bool
372 return false;
373 get $is$CyclicInitializationError() → core::bool
374 return false;
375 get $is$RangeError() → core::bool
376 return false;
377 get $is$int() → core::bool
378 return false;
379 get $is$double() → core::bool
380 return false;
381 get $is$List() → core::bool
382 return false;
383 get $is$String() → core::bool
384 return false;
385 get $is$Object() → core::bool
386 return true;
387 get $is$bool() → core::bool
388 return false;
389 get $is$UnsupportedError() → core::bool
390 return false;
391 get $is$ArgumentError() → core::bool
392 return false;
393 get $is$IntegerDivisionByZeroException() → core::bool
394 return false;
395 }
396 static field dynamic foo = self::bar;
397 static field dynamic bar = self::foo;
398 static final field core::List<dec::Class> $declarations = (core::List<dec::Class > d) → core::List<dec::Class> {
399 dec::init(d, 0, new typ::Interface::•(d.[](18)));
400 dec::init(d, 1, new typ::Interface::•(d.[](18)));
401 dec::init(d, 2, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface: :•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const t yp::Dynamic::•(), 0, <dynamic>[]));
402 dec::init(d, 3, new typ::Interface::•(d.[](27)));
403 dec::init(d, 4, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface: :•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const t yp::Dynamic::•(), 0, <dynamic>[const typ::Dynamic::•()]));
404 dec::init(d, 5, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface: :•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const t yp::Dynamic::•(), 0, <dynamic>[]));
405 dec::init(d, 6, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface: :•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const t yp::Dynamic::•(), 0, <dynamic>[const typ::Dynamic::•()]));
406 dec::init(d, 7, new typ::Interface::•(d.[](27)));
407 dec::init(d, 8, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface: :•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const t yp::Dynamic::•(), 0, <dynamic>[]));
408 dec::init(d, 9, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface: :•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const t yp::Dynamic::•(), 0, <dynamic>[const typ::Dynamic::•()]));
409 dec::init(d, 10, new typ::Interface::•(d.[](27)));
410 dec::init(d, 11, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface ::•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const typ::Dynamic::•(), 0, <dynamic>[]));
411 dec::init(d, 12, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface ::•(d.[](28), <dynamic>[d.[](12).variables.[](0)])]);
412 dec::init(d, 13, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface ::•(d.[](26))], new typ::FunctionType::•(new typ::Interface::•(d.[](26)), const typ::Dynamic::•(), 0, <dynamic>[const typ::Dynamic::•()]));
413 dec::init(d, 14, new typ::Interface::•(d.[](21)));
414 dec::init(d, 15, new typ::Interface::•(d.[](29)));
415 dec::init(d, 16, new typ::Interface::•(d.[](29)));
416 dec::init(d, 17, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface ::•(d.[](30), <dynamic>[new typ::Interface::•(d.[](17))]), new typ::Interface::• (d.[](31))]);
417 dec::init(d, 18, null);
418 dec::init(d, 19, new typ::Interface::•(d.[](18)));
419 dec::init(d, 20, new typ::Interface::•(d.[](27)));
420 dec::init(d, 21, new typ::Interface::•(d.[](27)));
421 dec::init(d, 22, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface ::•(d.[](32))]);
422 dec::init(d, 23, new typ::Interface::•(d.[](18)));
423 dec::init(d, 24, new typ::Interface::•(d.[](18)));
424 dec::init(d, 26, new typ::Interface::•(d.[](18)));
425 dec::init(d, 27, new typ::Interface::•(d.[](18)));
426 dec::init(d, 28, new typ::Interface::•(d.[](33), <dynamic>[d.[](28).variables. [](0)]));
427 dec::init(d, 29, new typ::Interface::•(d.[](18)), <dynamic>[new typ::Interface ::•(d.[](30), <dynamic>[new typ::Interface::•(d.[](29))])]);
428 dec::init(d, 30, new typ::Interface::•(d.[](18)));
429 dec::init(d, 31, new typ::Interface::•(d.[](18)));
430 dec::init(d, 32, new typ::Interface::•(d.[](18)));
431 dec::init(d, 33, new typ::Interface::•(d.[](18)));
432 return d;
433 }.call(dec::allocateDeclarations(<dynamic>["C", "D", "Closure#main#function", "A bstractClassInstantiationError", "Closure#main#function#1", "Closure#main#functi on#2", "Closure#main#function#3", "NoSuchMethodError", "Closure#main#function#4" , "Closure#main#function#5", "CyclicInitializationError", "Closure#main#function #6", "List", "Closure#main#function#7", "RangeError", "int", "double", "String", "Object", "bool", "UnsupportedError", "ArgumentError", "IntegerDivisionByZeroEx ception", "Null", "Type", "HasRuntimeTypeGetter", "Function", "Error", "Efficien tLengthIterable", "num", "Comparable", "Pattern", "Exception", "Iterable"], <dyn amic>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1]));
434 static method main() → dynamic {
435 tes::expectTrue(typ::isSubtypeOf(int::type(1), new typ::Interface::•(self::$de clarations.[](15))));
436 tes::expectTrue(!typ::isSubtypeOf(int::type(1), new typ::Interface::•(self::$d eclarations.[](16))));
437 tes::expectTrue(typ::isSubtypeOf(int::type(int::attachType(core::List::_intern al<core::int>(), new typ::Interface::•(self::$declarations.[](12), <dynamic>[new typ::Interface::•(self::$declarations.[](15))]))), new typ::Interface::•(self:: $declarations.[](12), <dynamic>[new typ::Interface::•(self::$declarations.[](15) )])));
438 tes::expectTrue(!typ::isSubtypeOf(int::type(int::attachType(core::List::_inter nal<core::int>(), new typ::Interface::•(self::$declarations.[](12), <dynamic>[ne w typ::Interface::•(self::$declarations.[](15))]))), new typ::Interface::•(self: :$declarations.[](12), <dynamic>[new typ::Interface::•(self::$declarations.[](16 ))])));
439 tes::expectTrue(typ::isSubtypeOf(int::type("hest"), new typ::Interface::•(self ::$declarations.[](17))));
440 tes::expectTrue(!typ::isSubtypeOf(int::type("hest"), new typ::Interface::•(sel f::$declarations.[](15))));
441 tes::expectTrue(!typ::isSubtypeOf(int::type(null), new typ::Interface::•(self: :$declarations.[](17))));
442 tes::expectTrue(typ::isSubtypeOf(int::type(null), const typ::Dynamic::•()));
443 tes::expectTrue(typ::isSubtypeOf(int::type(null), new typ::Interface::•(self:: $declarations.[](18))));
444 tes::expectTrue(typ::isSubtypeOf(int::type(true), new typ::Interface::•(self:: $declarations.[](19))));
445 tes::expectTrue(!typ::isSubtypeOf(int::type(true), new typ::Interface::•(self: :$declarations.[](15))));
446 tes::expectThrows(new self::Closure#main#function::•(null), new self::Closure# main#function#1::•(null));
447 tes::expectThrows(new self::Closure#main#function#2::•(null), new self::Closur e#main#function#3::•(null));
448 tes::expectThrows(new self::Closure#main#function#4::•(null), new self::Closur e#main#function#5::•(null));
449 tes::expectThrows(new self::Closure#main#function#6::•(null), new self::Closur e#main#function#7::•(null));
450 tes::expectTrue(typ::isSubtypeOf(int::type(int::attachType(new core::Unsupport edError::•(""), new typ::Interface::•(self::$declarations.[](20)))), new typ::In terface::•(self::$declarations.[](20))));
451 tes::expectTrue(typ::isSubtypeOf(int::type(int::attachType(new core::ArgumentE rror::•(), new typ::Interface::•(self::$declarations.[](21)))), new typ::Interfa ce::•(self::$declarations.[](21))));
452 tes::expectTrue(typ::isSubtypeOf(int::type(int::attachType(new core::IntegerDi visionByZeroException::•(), new typ::Interface::•(self::$declarations.[](22)))), new typ::Interface::•(self::$declarations.[](22))));
453 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/reify/native_types_test.dart ('k') | pkg/kernel/testcases/reify/reuse_type_variables_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698