godot
godot copied to clipboard
C#: Fix marshaling generic Godot collections
Add support for generic Godot collections to ConvertManagedObjectToVariant.
- Fixes https://github.com/godotengine/godot/issues/65883
This was removed on purpose. I've thought of a way to add it back, though, including for type parameters of Godot generic collections and delegate invocations. Let's leave this unmerged for now, until I make these changes, then I can decide whether this is the proper solution for ConvertManagedObjectToVariant (if this method even remains).
This change is only about the default value, right? If that's the case, I can change GetGodotPropertyDefaultValues to return Variant. That would be one usage less of ConvertManagedObjectToVariant. The last usage would be in DelegateUtils, which I have an idea how to replace too.
Yes, it's only about the default value. The error is printed from GetGodotPropertyDefaultValues calling ConvertManagedObjectToVariant.
The DelegateUtils usage seems complicated to replace. It uses System.Object because it needs reflection to access the fields of compiler generated classes (<>c__DisplayClass) for closures (needed by the editor during assembly reloading). I'll accept this PR, as we can't fully get rid of ConvertManagedObjectToVariant yet.