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:
commit
4eaafc8fa8
4 changed files with 69 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue