OLD | NEW |
(Empty) | |
| 1 library field_initializer_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 field dynamic a1 = self::p("a1"); |
| 11 field dynamic a2; |
| 12 final field typ::ReifiedType $type; |
| 13 constructor •(typ::ReifiedType $type) → void |
| 14 : self::A::$type = $type, self::A::a2 = self::p("a2"), super core::Object::•
() { |
| 15 self::p("A"); |
| 16 } |
| 17 get $A$T() → typ::ReifiedType |
| 18 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](0))).[](0); |
| 19 get runtimeType() → core::Type |
| 20 return this.{=self::A::$type}; |
| 21 } |
| 22 class B extends self::A implements int::HasRuntimeTypeGetter { |
| 23 field dynamic b1 = self::p("b1"); |
| 24 field dynamic b2 = self::p("b2"); |
| 25 field dynamic b3; |
| 26 field dynamic b4; |
| 27 constructor •(typ::ReifiedType $type) → void |
| 28 : self::B::b3 = self::p("b3"), self::B::b4 = self::p("b4"), super self::A::•
($type) { |
| 29 self::p("B"); |
| 30 } |
| 31 get $B$T() → typ::ReifiedType |
| 32 return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declaratio
ns.[](1))).[](0); |
| 33 } |
| 34 static final field core::List<dec::Class> $declarations = (core::List<dec::Class
> d) → core::List<dec::Class> { |
| 35 dec::init(d, 0, new typ::Interface::•(d.[](15))); |
| 36 dec::init(d, 1, new typ::Interface::•(d.[](0), <dynamic>[d.[](1).variables.[](
0)])); |
| 37 dec::init(d, 2, new typ::Interface::•(d.[](15))); |
| 38 dec::init(d, 3, new typ::Interface::•(d.[](15))); |
| 39 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))]); |
| 40 dec::init(d, 5, new typ::Interface::•(d.[](19))); |
| 41 dec::init(d, 6, new typ::Interface::•(d.[](19))); |
| 42 dec::init(d, 7, new typ::Interface::•(d.[](15))); |
| 43 dec::init(d, 8, new typ::Interface::•(d.[](20))); |
| 44 dec::init(d, 9, new typ::Interface::•(d.[](20))); |
| 45 dec::init(d, 10, new typ::Interface::•(d.[](20))); |
| 46 dec::init(d, 11, new typ::Interface::•(d.[](20))); |
| 47 dec::init(d, 12, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface
::•(d.[](21))]); |
| 48 dec::init(d, 13, new typ::Interface::•(d.[](14))); |
| 49 dec::init(d, 14, new typ::Interface::•(d.[](20))); |
| 50 dec::init(d, 15, null); |
| 51 dec::init(d, 17, new typ::Interface::•(d.[](15))); |
| 52 dec::init(d, 18, new typ::Interface::•(d.[](15))); |
| 53 dec::init(d, 19, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface
::•(d.[](17), <dynamic>[new typ::Interface::•(d.[](19))])]); |
| 54 dec::init(d, 20, new typ::Interface::•(d.[](15))); |
| 55 dec::init(d, 21, new typ::Interface::•(d.[](15))); |
| 56 return d; |
| 57 }.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])); |
| 58 static method p(dynamic x) → dynamic { |
| 59 tes::write(x); |
| 60 return x; |
| 61 } |
| 62 static method main() → dynamic { |
| 63 dynamic b = new self::B::•(new typ::Interface::•(self::$declarations.[](1), <d
ynamic>[const typ::Dynamic::•()])); |
| 64 tes::expectOutput("b1\nb2\nb3\nb4\na1\na2\nA\nB"); |
| 65 } |
OLD | NEW |