HxGodot / hxgodot

A Haxe GDExtension for Godot 4
MIT License
232 stars 11 forks source link

layered virtual functions are not correctly dealt with #32

Closed dazKind closed 1 year ago

dazKind commented 1 year ago

reported by @erpfi on Discord:

class Base extends godot.Node {
    override function _ready() {}
}

class Child extends Base {
    override function _ready() {}
}

generates the following error:

/haxe/lib/hxgodot/git/src/godot/macros/Macros.hx:782: lines 782-784 : Duplicate class field declaration : stc.Child.virtual_Child__ready
src/stc/Test.hx:21: lines 21-23 : ... Defined in this class

This also happens with custom functions, but only if the base class inherits a godot class, and if the inheritance hierarchy is at least 3 deep:

class Base extends godot.Node {
    function custom() {}
}

// works
class Child extends Base {
    override function custom() {}
}

// doesn't
class Child2 extends Child {
    override function custom() {}
}
dazKind commented 1 year ago

This should be fixed now