don't marshal multidimensional arrays

This commit is contained in:
antonWetzel 2022-09-16 23:51:17 +02:00
parent 57bdddce02
commit 5090355907

View File

@ -156,6 +156,10 @@ namespace Godot.SourceGenerators
else if (typeKind == TypeKind.Array) else if (typeKind == TypeKind.Array)
{ {
var arrayType = (IArrayTypeSymbol)type; var arrayType = (IArrayTypeSymbol)type;
if (arrayType.Rank != 1)
return null;
var elementType = arrayType.ElementType; var elementType = arrayType.ElementType;
switch (elementType.SpecialType) switch (elementType.SpecialType)
@ -177,8 +181,8 @@ namespace Godot.SourceGenerators
if (elementType.SimpleDerivesFrom(typeCache.GodotObjectType)) if (elementType.SimpleDerivesFrom(typeCache.GodotObjectType))
return MarshalType.GodotObjectOrDerivedArray; return MarshalType.GodotObjectOrDerivedArray;
if (elementType.ContainingAssembly.Name == "GodotSharp" && if (elementType.ContainingAssembly?.Name == "GodotSharp" &&
elementType.ContainingNamespace.Name == "Godot") elementType.ContainingNamespace?.Name == "Godot")
{ {
switch (elementType) switch (elementType)
{ {