Closed PXshadow closed 1 year ago
I ran into this issue as well.
One of the errors I have is in the generated bindings/godot/Node.hx where the process_mode
property is defined as type cpp.Int64
, but set_process_mode
is defined as function set_process_mode(mode:cpp.Int32):cpp.Int64
. The argument type should be defined as cpp.Int64
.
This is due to the way hxgodot is handling enum values. In extension_api.json the Node.process_mode
property is defined as type int
(which is translated to cpp.Int64
in TypeMacros.hx) but the method Node.set_process_mode
has it's argument defined as type enum::Node.ProcessMode
and enums are translated to cpp.Int32
in ClassGenMacros._generateClasses
.
Changing the translated enum type to cpp.Int64
resolves these errors. I suspect I'm misunderstanding something though, because if this is the issue shouldn't the errors throw for everyone using hxgodot?
That still leaves the "godot.variant.Variant should be Int"
errors which I have not looked into yet. I'm still fairly new to Haxe and this is my first time working with macros, but I'll look into that one later. Hopefully this is helpful
Oh that actually makes sense. I will do a bugfix pass tonight. Interestingly with a non-nightly / stable version we dont see these errors
I isolated the error here: https://gist.github.com/dazKind/8a916288a9b4bdcf8b64ae6d2eee1265
Turns out that the culprit is https://github.com/HaxeFoundation/haxe/pull/10133 which has not been released on stable before, hence why everything silently works on 4.2.5. Im not sure yet what a feasible solution could be since it totally breaks with normal for-loops and int64
This is solved with the official support for Haxe 4.3.1
os: mac os 64x intel Haxe version: 4.3.0-rc.1+660947b Godot version: Godot_v4.0-beta14
Seems to be related to hxcpp changes in basic types.