mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Multi-dimensional sized array name printing fix
This commit is contained in:
parent
88121831e2
commit
ad7ef19004
2 changed files with 45 additions and 11 deletions
|
@ -14565,15 +14565,30 @@ void BfModule::DoTypeToString(StringImpl& str, BfType* resolvedType, BfTypeNameF
|
|||
}
|
||||
else if (resolvedType->IsSizedArray())
|
||||
{
|
||||
auto arrayType = (BfSizedArrayType*)resolvedType;
|
||||
if (arrayType->mElementCount == -1)
|
||||
SizedArray<intptr, 4> sizes;
|
||||
|
||||
auto checkType = resolvedType;
|
||||
while (true)
|
||||
{
|
||||
DoTypeToString(str, arrayType->mElementType, typeNameFlags, genericMethodNameOverrides);
|
||||
str += "[?]";
|
||||
return;
|
||||
if (checkType->IsSizedArray())
|
||||
{
|
||||
auto arrayType = (BfSizedArrayType*)checkType;
|
||||
sizes.Add(arrayType->mElementCount);
|
||||
checkType = arrayType->mElementType;
|
||||
continue;
|
||||
}
|
||||
|
||||
DoTypeToString(str, checkType, typeNameFlags, genericMethodNameOverrides);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)sizes.mSize; i++)
|
||||
{
|
||||
if (sizes[i] == -1)
|
||||
str += "[?]";
|
||||
else
|
||||
str += StrFormat("[%d]", sizes[i]);
|
||||
}
|
||||
DoTypeToString(str, arrayType->mElementType, typeNameFlags, genericMethodNameOverrides);
|
||||
str += StrFormat("[%d]", arrayType->mElementCount);
|
||||
return;
|
||||
}
|
||||
else if (resolvedType->IsConstExprValue())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue