From 9dafabd1ee3d5e525be74b2ef6a13be55f1591a4 Mon Sep 17 00:00:00 2001 From: walon Date: Thu, 31 Aug 2023 11:06:06 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E6=A1=A5=E6=8E=A5?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E7=AD=BE=E5=90=8D=E8=AE=A1=E7=AE=97=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/MethodBridge/Generator.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Editor/MethodBridge/Generator.cs b/Editor/MethodBridge/Generator.cs index e105aa8..ba5bc66 100644 --- a/Editor/MethodBridge/Generator.cs +++ b/Editor/MethodBridge/Generator.cs @@ -361,6 +361,8 @@ namespace HybridCLR.Editor.MethodBridge } } + public const string SigOfObj = "u"; + public static string ToFullName(TypeSig type) { type = type.RemovePinnedAndModifiers(); @@ -372,15 +374,15 @@ namespace HybridCLR.Editor.MethodBridge case ElementType.U1: return "u1"; case ElementType.I2: return "i2"; case ElementType.Char: - case ElementType.U2: return "i2"; + case ElementType.U2: return "u2"; case ElementType.I4: return "i4"; case ElementType.U4: return "u4"; case ElementType.I8: return "i8"; case ElementType.U8: return "u8"; case ElementType.R4: return "r4"; case ElementType.R8: return "r8"; - case ElementType.U: return "u"; - case ElementType.I: + case ElementType.I: return "i"; + case ElementType.U: case ElementType.String: case ElementType.Ptr: case ElementType.ByRef: @@ -389,7 +391,7 @@ namespace HybridCLR.Editor.MethodBridge case ElementType.SZArray: case ElementType.FnPtr: case ElementType.Object: - return "i"; + return SigOfObj; case ElementType.Module: case ElementType.Var: case ElementType.MVar: @@ -413,7 +415,7 @@ namespace HybridCLR.Editor.MethodBridge GenericInstSig gis = (GenericInstSig)type; if (!gis.GenericType.IsValueType) { - return "i"; + return SigOfObj; } TypeDef typeDef = gis.GenericType.ToTypeDefOrRef().ResolveTypeDef(); if (typeDef.IsEnum)