Closed Mercerenies closed 2 years ago
Constructor super calls which appear at the beginning of the constructor have already been handled, as per acf44c2. That leaves a handful of cases left to consider.
As an example of the last case, the following code
(defclass Foo ()
(defn foo () (lambda () (super)))
should compile to something like (simplifying the lambda expansion for the purposes of brevity)
class Lambda:
var _self
func _init(_self):
self._self = _self
func call_func():
self._self._super_foo()
class Foo(Reference):
func foo():
return Lambda.new(self)
func _super_foo():
return .foo()
Implemented fully as of 4baee4e.
Calling superclass methods. I might suggest the literal word
super
being reserved for this purposeConstructors will need to be special-cased, as the constructor super call must appear first (like in Java). We don't even handle constructor super calls in the
gdscript
syntax tree right now, so that will need to be implemented too.