This test should behave differently (from tests/co19/src/Language/Expressions/Instance_Creation/New/execution_t09.dart):
import 'tests/co19/src/Utils/expect.dart';
var evalOrder = '';
log(var s) {
evalOrder = '$evalOrder$s';
}
class A {
A() : this.a2();
A.a2() {
log("2");
}
}
class B extends A {
var v;
B.b2() : super(), v = log("1") {
log("3");
}
}
main() {
new B.b2();
Expect.equals("123", evalOrder, "Super constructor was not executed properly!");
}
This get compiled to:
class A extends core::Object {
constructor •() → void
: this test::A::a2();
constructor a2() → void {
test::log("2");
}
}
class B extends test::A {
field dynamic v;
constructor b2() → void
: super test::A::•(), test::B::v = test::log("1") {
test::log("3");
}
}
static field dynamic evalOrder = "";
static method log(dynamic s) → dynamic {
test::evalOrder = "${test::evalOrder}${s}";
}
static method main() → dynamic {
new test::B::b2();
Exp::Expect::equals("123", test::evalOrder, "Super constructor was not executed properly!");
}
It is probably supposed to re-order the initializers
This test should behave differently (from
tests/co19/src/Language/Expressions/Instance_Creation/New/execution_t09.dart
):This get compiled to:
It is probably supposed to re-order the initializers
from
to
/cc @peter-ahe-google