They are now invoked like "new Foo". Also, superclass constructors are now much less semantically and syntactically weird. Since the instance is created before any constructor is called, there's no point in time where the instance isn't there.
19 lines
176 B
Plaintext
19 lines
176 B
Plaintext
class A {
|
|
foo {
|
|
io.write("A.foo")
|
|
}
|
|
}
|
|
|
|
class B is A {}
|
|
|
|
class C is B {
|
|
foo {
|
|
io.write("C.foo")
|
|
super.foo
|
|
}
|
|
}
|
|
|
|
(new C).foo
|
|
// expect: C.foo
|
|
// expect: A.foo
|