1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Merge pull request #91375 from paulloz/dotnet/prevent-generator-crash-on-exported-unconstructed-generic-arrays

C#: Fix generator crash w/ generic arrays
This commit is contained in:
Rémi Verschelde
2024-05-02 12:46:42 +02:00
4 changed files with 69 additions and 1 deletions

View File

@@ -658,7 +658,10 @@ namespace Godot.SourceGenerators
var elementType = MarshalUtils.GetArrayElementType(type);
if (elementType == null)
return false; // Non-generic Array, so there's no hint to add
return false; // Non-generic Array, so there's no hint to add.
if (elementType.TypeKind == TypeKind.TypeParameter)
return false; // The generic is not constructed, we can't really hint anything.
var elementMarshalType = MarshalUtils.ConvertManagedTypeToMarshalType(elementType, typeCache)!.Value;
var elementVariantType = MarshalUtils.ConvertMarshalTypeToVariantType(elementMarshalType)!.Value;