[GDExtension] Cannot convert Variant
to other types correctly
#75757
Labels
Milestone
Variant
to other types correctly
#75757
Godot version
4.0.2.stable.official.7a0977ce2
System information
Linux
Issue description
The following code fails with godot-cpp
When godot-cpp converts a
Variant
to another type, it callstype_from_variant_constructor
without checking its type. It only doesreinterpret_cast
and does no type conversion.I think this issue can be solved by implementing type conversion on the godot-cpp side or by making
type_from_variant_constructor
do the type conversion.Steps to reproduce
Unzip the minimal reproduction project and run
scons
to build the GDExtension.Minimal reproduction project
variant-conversion-issue.zip
The text was updated successfully, but these errors were encountered: