Open YooRarely opened 1 month ago
Moving to the godot-cpp as it's related to its own implementation of String.
I'm really surprised to learn we have these operator%(...)
methods in godot-cpp!
Since this isn't supported in Godot itself, having them goes against one of godot-cpp design goals, which is to support the same API as Godot. I think it might be better to remove these operators, rather than fix them. We appear to be automatically generating them based on the extension_api.json
, so it'd be a matter of filtering them out in binding_generator.py
.
Using vformat()
would be the recommended way to do this kind of string formatting in godot-cpp
Tested versions
System information
Windows 11
Issue description
I found that the
module_Variant
method for theString
type in GDExtension did not return the correct result. They all returned an incorrect result<null>
. Could this be a bug? I haven't found any posts mentioning a similar issue.Steps to reproduce
I tried the following code. The output on the left is correct, while the result on the right is incorrect.
They each used different overloaded operators, as shown below.
source_code
So, I had to resort to the most cumbersome way, using a
switch
statement to solve the issue where theVariant
type couldn't be handled correctly.Minimal reproduction project (MRP)
1