Start getting superclass constructors working.
This also means the metaclass inheritance hierarchy parallels the regular inheritance chain so that the subclass can find the superclass constructor.
This commit is contained in:
@@ -2,12 +2,14 @@ class Foo {
|
||||
methodOnFoo { io.write("foo") }
|
||||
method(a) { io.write("foo") }
|
||||
method(a, b, c) { io.write("foo") }
|
||||
override { io.write("foo") }
|
||||
}
|
||||
|
||||
class Bar is Foo {
|
||||
methodOnBar { io.write("bar") }
|
||||
method(a, b) { io.write("bar") }
|
||||
method(a, b, c, d) { io.write("bar") }
|
||||
override { io.write("bar") }
|
||||
}
|
||||
|
||||
var bar = Bar.new
|
||||
@@ -19,9 +21,6 @@ bar.method(1) // expect: foo
|
||||
bar.method(1, 2) // expect: bar
|
||||
bar.method(1, 2, 3) // expect: foo
|
||||
bar.method(1, 2, 3, 4) // expect: bar
|
||||
bar.override // expect: bar
|
||||
|
||||
// TODO: Overriding.
|
||||
// TODO: Private fields.
|
||||
// TODO: Super (or inner) calls.
|
||||
// TODO: Grammar for what expressions can follow "is".
|
||||
// TODO: Prevent extending built-in types.
|
||||
|
||||
Reference in New Issue
Block a user