OLD | NEW |
1 library field_initializer2_test; | 1 library field_initializer2_test; |
2 import self as self; | 2 import self as self; |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "../../runtime/reify/interceptors.dart" as int; | 4 import "../../runtime/reify/interceptors.dart" as int; |
5 import "../../runtime/reify/types.dart" as typ; | 5 import "../../runtime/reify/types.dart" as typ; |
6 import "./test_base.dart" as tes; | 6 import "./test_base.dart" as tes; |
7 import "../../runtime/reify/declarations.dart" as dec; | 7 import "../../runtime/reify/declarations.dart" as dec; |
8 | 8 |
9 class A extends core::Object implements int::HasRuntimeTypeGetter { | 9 class A extends core::Object implements int::HasRuntimeTypeGetter { |
10 final field typ::ReifiedType $type; | 10 final field typ::ReifiedType $type; |
11 constructor •(typ::ReifiedType $type) → void | 11 constructor •(typ::ReifiedType $type) → void |
12 : self::A::$type = $type, super core::Object::•() | 12 : self::A::$type = $type, super core::Object::•() |
13 ; | 13 ; |
14 get $A$T() → typ::ReifiedType | 14 get $A$T() → typ::ReifiedType |
15 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](0))).[](0); | 15 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](0))).[](0); |
16 get $is$A() → core::bool | 16 get $is$A() → core::bool |
17 return true; | 17 return true; |
18 get runtimeType() → core::Type | 18 get runtimeType() → core::Type |
19 return this.{=self::A::$type}; | 19 return this.{=self::A::$type}; |
20 } | 20 } |
21 class B extends core::Object implements int::HasRuntimeTypeGetter { | 21 class B extends core::Object implements int::HasRuntimeTypeGetter { |
22 field dynamic x; | 22 field self::A x; |
23 field dynamic y; | 23 field dynamic y; |
24 final field typ::ReifiedType $type; | 24 final field typ::ReifiedType $type; |
25 constructor •(typ::ReifiedType $type) → void | 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::•() | 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 ; | 27 ; |
| 28 set x$cc(self::A x_) → dynamic { |
| 29 this.{=self::B::x} = x_ as self::A; |
| 30 } |
28 get $B$T() → typ::ReifiedType | 31 get $B$T() → typ::ReifiedType |
29 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](1))).[](0); | 32 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](1))).[](0); |
30 get $is$A() → core::bool | 33 get $is$A() → core::bool |
31 return false; | 34 return false; |
32 get runtimeType() → core::Type | 35 get runtimeType() → core::Type |
33 return this.{=self::B::$type}; | 36 return this.{=self::B::$type}; |
34 static method $init$x(dynamic $type) → dynamic | 37 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))))); | 38 return new self::A::•(new typ::Interface::•(self::$declarations.[](0), typ::
getTypeArguments(typ::asInstanceOf($type, self::$declarations.[](1))))); |
36 } | 39 } |
37 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { | 40 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { |
(...skipping 14 matching lines...) Expand all Loading... |
52 dec::init(d, 14, new typ::Interface::•(d.[](20))); | 55 dec::init(d, 14, new typ::Interface::•(d.[](20))); |
53 dec::init(d, 15, null); | 56 dec::init(d, 15, null); |
54 dec::init(d, 17, new typ::Interface::•(d.[](15))); | 57 dec::init(d, 17, new typ::Interface::•(d.[](15))); |
55 dec::init(d, 18, new typ::Interface::•(d.[](15))); | 58 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))])]); | 59 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))); | 60 dec::init(d, 20, new typ::Interface::•(d.[](15))); |
58 dec::init(d, 21, new typ::Interface::•(d.[](15))); | 61 dec::init(d, 21, new typ::Interface::•(d.[](15))); |
59 return d; | 62 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])); | 63 }.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 { | 64 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::•()])])); | 65 self::B 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))); | 66 tes::expectTrue(let dynamic #t1 = b.{self::B::x} in #t1 is int::HasRuntimeType
Getter && #t1.$is$A && (let dynamic #t2 = new typ::Interface::•(self::$declarati
ons.[](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))); | 67 tes::expectTrue(let dynamic #t3 = b.{self::B::y} in #t3 is int::HasRuntimeType
Getter && #t3.$is$A && (let dynamic #t4 = new typ::Interface::•(self::$declarati
ons.[](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))); | 68 tes::expectFalse(let dynamic #t5 = b.{self::B::x} in #t5 is int::HasRuntimeTyp
eGetter && #t5.$is$A && (let dynamic #t6 = new typ::Interface::•(self::$declarat
ions.[](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))); | 69 tes::expectFalse(let dynamic #t7 = b.{self::B::y} in #t7 is int::HasRuntimeTyp
eGetter && #t7.$is$A && (let dynamic #t8 = new typ::Interface::•(self::$declarat
ions.[](0), <dynamic>[new typ::Interface::•(self::$declarations.[](1), <dynamic>
[const typ::Dynamic::•()])]) in typ::isSubtypeOf(#t7.$type, #t8))); |
67 } | 70 } |
OLD | NEW |