1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 01:18:02 +02:00

Multi-dimensional sized array name printing fix

This commit is contained in:
Brian Fiete 2022-02-21 05:50:08 -08:00
parent 88121831e2
commit ad7ef19004
2 changed files with 45 additions and 11 deletions

View file

@ -1156,10 +1156,29 @@ namespace System.Reflection
public override void GetFullName(String strBuffer)
{
UnderlyingType.GetFullName(strBuffer);
strBuffer.Append("[");
mElementCount.ToString(strBuffer);
strBuffer.Append("]");
List<int> sizes = scope .(4);
Type checkType = this;
while (true)
{
if (var arrayType = checkType as SizedArrayType)
{
sizes.Add(arrayType.mElementCount);
checkType = arrayType.UnderlyingType;
continue;
}
checkType.GetFullName(strBuffer);
break;
}
for (var size in sizes)
{
if (size == -1)
strBuffer.Append("[?]");
else
strBuffer.AppendF($"[{size}]");
}
}
}