blob: 8490bf346088d150ecb78a5b513fd2d6ced2096f [file] [log] [blame]
library field_initializer_test;
import self as self;
import "dart:core" as core;
import "../../runtime/reify/interceptors.dart" as int;
import "../../runtime/reify/types.dart" as typ;
import "./test_base.dart" as tes;
import "../../runtime/reify/declarations.dart" as dec;
class A extends core::Object implements int::HasRuntimeTypeGetter {
field dynamic a1 = self::p("a1");
field dynamic a2;
final field typ::ReifiedType $type;
constructor •(typ::ReifiedType $type) void
: self::A::$type = $type, self::A::a2 = self::p("a2"), super core::Object::•() {
self::p("A");
}
get $A$T() typ::ReifiedType
return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declarations.[](0))).[](0);
get runtimeType() core::Type
return this.{=self::A::$type};
}
class B extends self::A implements int::HasRuntimeTypeGetter {
field dynamic b1 = self::p("b1");
field dynamic b2 = self::p("b2");
field dynamic b3;
field dynamic b4;
constructor •(typ::ReifiedType $type) void
: self::B::b3 = self::p("b3"), self::B::b4 = self::p("b4"), super self::A::•($type) {
self::p("B");
}
get $B$T() typ::ReifiedType
return typ::getTypeArguments(typ::asInstanceOf(this.$type, self::$declarations.[](1))).[](0);
}
static final field core::List<dec::Class> $declarations = (core::List<dec::Class> d) core::List<dec::Class> {
dec::init(d, 0, new typ::Interface::•(d.[](15)));
dec::init(d, 1, new typ::Interface::•(d.[](0), <dynamic>[d.[](1).variables.[](0)]));
dec::init(d, 2, new typ::Interface::•(d.[](15)));
dec::init(d, 3, new typ::Interface::•(d.[](15)));
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))]);
dec::init(d, 5, new typ::Interface::•(d.[](19)));
dec::init(d, 6, new typ::Interface::•(d.[](19)));
dec::init(d, 7, new typ::Interface::•(d.[](15)));
dec::init(d, 8, new typ::Interface::•(d.[](20)));
dec::init(d, 9, new typ::Interface::•(d.[](20)));
dec::init(d, 10, new typ::Interface::•(d.[](20)));
dec::init(d, 11, new typ::Interface::•(d.[](20)));
dec::init(d, 12, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface::•(d.[](21))]);
dec::init(d, 13, new typ::Interface::•(d.[](14)));
dec::init(d, 14, new typ::Interface::•(d.[](20)));
dec::init(d, 15, null);
dec::init(d, 17, new typ::Interface::•(d.[](15)));
dec::init(d, 18, new typ::Interface::•(d.[](15)));
dec::init(d, 19, new typ::Interface::•(d.[](15)), <dynamic>[new typ::Interface::•(d.[](17), <dynamic>[new typ::Interface::•(d.[](19))])]);
dec::init(d, 20, new typ::Interface::•(d.[](15)));
dec::init(d, 21, new typ::Interface::•(d.[](15)));
return d;
}.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]));
static method p(dynamic x) dynamic {
tes::write(x);
return x;
}
static method main() dynamic {
self::B b = new self::B::•(new typ::Interface::•(self::$declarations.[](1), <dynamic>[const typ::Dynamic::•()]));
tes::expectOutput("b1\nb2\nb3\nb4\na1\na2\nA\nB");
}