diff options
author | Paul Joannon <hello@pauljoannon.com> | 2024-04-30 22:21:21 +0200 |
---|---|---|
committer | Paul Joannon <hello@pauljoannon.com> | 2024-04-30 22:22:09 +0200 |
commit | aba787393fd25091e7945f1aba27acfd11449b12 (patch) | |
tree | 2e5ddb9fdd189d55c8de08bc826bbdaa0e267eb5 /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators | |
parent | d282e4f0e6b6ebcf3bd6e05cd62f2a8fe1f9a238 (diff) | |
download | redot-engine-aba787393fd25091e7945f1aba27acfd11449b12.tar.gz |
C#: Fix generator crash w/ generic arrays
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs index a0e410e31a..21223654f3 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs @@ -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; |