OLD | NEW |
(Empty) | |
| 1 library field_initializer2_test; |
| 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 "./test_base.dart" as tes; |
| 7 import "../../runtime/reify/declarations.dart" as dec; |
| 8 |
| 9 class A extends core::Object implements int::HasRuntimeTypeGetter { |
| 10 final field typ::ReifiedType $type; |
| 11 constructor •(typ::ReifiedType $type) → void |
| 12 : self::A::$type = $type, super core::Object::•() |
| 13 ; |
| 14 get $A$T() → typ::ReifiedType |
| 15 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](0))).[](0); |
| 16 get $is$A() → core::bool |
| 17 return true; |
| 18 get runtimeType() → core::Type |
| 19 return this.{=self::A::$type}; |
| 20 } |
| 21 class B extends core::Object implements int::HasRuntimeTypeGetter { |
| 22 field dynamic x; |
| 23 field dynamic y; |
| 24 final field typ::ReifiedType $type; |
| 25 constructor •(typ::ReifiedType $type) → void |
| 26 : self::B::x = self::B::$init$x($type), self::B::$type = $type, self::B::y =
new self::A::•(new typ::Interface::•(self::$declarations.[](0), typ::getTypeArg
uments(typ::asInstanceOf($type, self::$declarations.[](1))))), super core::Objec
t::•() |
| 27 ; |
| 28 get $B$T() → typ::ReifiedType |
| 29 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](1))).[](0); |
| 30 get $is$A() → core::bool |
| 31 return false; |
| 32 get runtimeType() → core::Type |
| 33 return this.{=self::B::$type}; |
| 34 static method $init$x(dynamic $type) → dynamic |
| 35 return new self::A::•(new typ::Interface::•(self::$declarations.[](0), typ::
getTypeArguments(typ::asInstanceOf($type, self::$declarations.[](1))))); |
| 36 } |
| 37 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { |
| 38 dec::init(d, 0, new typ::Interface::•(d.[](15))); |
| 39 dec::init(d, 1, new typ::Interface::•(d.[](15))); |
| 40 dec::init(d, 2, new typ::Interface::•(d.[](15))); |
| 41 dec::init(d, 3, new typ::Interface::•(d.[](15))); |
| 42 dec::init(d, 4, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface:
:•(d.[](17), <dynamic>[new typ::Interface::•(d.[](4))]), new typ::Interface::•(d
.[](18))]); |
| 43 dec::init(d, 5, new typ::Interface::•(d.[](19))); |
| 44 dec::init(d, 6, new typ::Interface::•(d.[](19))); |
| 45 dec::init(d, 7, new typ::Interface::•(d.[](15))); |
| 46 dec::init(d, 8, new typ::Interface::•(d.[](20))); |
| 47 dec::init(d, 9, new typ::Interface::•(d.[](20))); |
| 48 dec::init(d, 10, new typ::Interface::•(d.[](20))); |
| 49 dec::init(d, 11, new typ::Interface::•(d.[](20))); |
| 50 dec::init(d, 12, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface
::•(d.[](21))]); |
| 51 dec::init(d, 13, new typ::Interface::•(d.[](14))); |
| 52 dec::init(d, 14, new typ::Interface::•(d.[](20))); |
| 53 dec::init(d, 15, null); |
| 54 dec::init(d, 17, new typ::Interface::•(d.[](15))); |
| 55 dec::init(d, 18, new typ::Interface::•(d.[](15))); |
| 56 dec::init(d, 19, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface
::•(d.[](17), <dynamic>[new typ::Interface::•(d.[](19))])]); |
| 57 dec::init(d, 20, new typ::Interface::•(d.[](15))); |
| 58 dec::init(d, 21, new typ::Interface::•(d.[](15))); |
| 59 return d; |
| 60 }.call(dec::allocateDeclarations(<dynamic>["A", "B", "Null", "bool", "String", "
int", "double", "Type", "AbstractClassInstantiationError", "NoSuchMethodError",
"CyclicInitializationError", "UnsupportedError", "IntegerDivisionByZeroException
", "RangeError", "ArgumentError", "Object", "HasRuntimeTypeGetter", "Comparable"
, "Pattern", "num", "Error", "Exception"], <dynamic>[1, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0])); |
| 61 static method main() → dynamic { |
| 62 dynamic b = new self::B::•(new typ::Interface::•(self::$declarations.[](1), <d
ynamic>[new typ::Interface::•(self::$declarations.[](0), <dynamic>[const typ::Dy
namic::•()])])); |
| 63 tes::expectTrue(let dynamic #t1 = b.x in #t1 is int::HasRuntimeTypeGetter && #
t1.$is$A && (let dynamic #t2 = new typ::Interface::•(self::$declarations.[](0),
<dynamic>[new typ::Interface::•(self::$declarations.[](0), <dynamic>[const typ::
Dynamic::•()])]) in typ::isSubtypeOf(#t1.$type, #t2))); |
| 64 tes::expectTrue(let dynamic #t3 = b.y in #t3 is int::HasRuntimeTypeGetter && #
t3.$is$A && (let dynamic #t4 = new typ::Interface::•(self::$declarations.[](0),
<dynamic>[new typ::Interface::•(self::$declarations.[](0), <dynamic>[const typ::
Dynamic::•()])]) in typ::isSubtypeOf(#t3.$type, #t4))); |
| 65 tes::expectFalse(let dynamic #t5 = b.x in #t5 is int::HasRuntimeTypeGetter &&
#t5.$is$A && (let dynamic #t6 = new typ::Interface::•(self::$declarations.[](0),
<dynamic>[new typ::Interface::•(self::$declarations.[](1), <dynamic>[const typ:
:Dynamic::•()])]) in typ::isSubtypeOf(#t5.$type, #t6))); |
| 66 tes::expectFalse(let dynamic #t7 = b.y in #t7 is int::HasRuntimeTypeGetter &&
#t7.$is$A && (let dynamic #t8 = new typ::Interface::•(self::$declarations.[](0),
<dynamic>[new typ::Interface::•(self::$declarations.[](1), <dynamic>[const typ:
:Dynamic::•()])]) in typ::isSubtypeOf(#t7.$type, #t8))); |
| 67 } |
OLD | NEW |