Fixed multi-dimension argument / return type (#55)

* Fixed multi dimension array arguments

* .

* .

* .

* ,
This commit is contained in:
Stef Heyenrath
2023-02-21 19:10:03 +01:00
committed by GitHub
parent 196db037ab
commit 65d1d801ce
8 changed files with 36 additions and 8 deletions
@@ -235,6 +235,7 @@ using System;
str.AppendLine(" {");
foreach (var ps in method.Parameters)
{
var type = FixType(ps.Type.ToString());
string normalOrMap = $" = {ps.GetSanitizedName()}";
if (ps.RefKind == RefKind.Out)
{
@@ -245,11 +246,11 @@ using System;
_ = GetParameterType(ps, out var isReplaced); // TODO : response is not used?
if (isReplaced)
{
normalOrMap = $" = Mapster.TypeAdapter.Adapt<{ps.Type}>({ps.GetSanitizedName()})";
normalOrMap = $" = Mapster.TypeAdapter.Adapt<{type}>({ps.GetSanitizedName()})";
}
}
str.AppendLine($" {ps.Type} {ps.GetSanitizedName()}_{normalOrMap};");
str.AppendLine($" {type} {ps.GetSanitizedName()}_{normalOrMap};");
}
var methodName = method.GetMethodNameWithOptionalTypeParameters();