1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Tuple reflected name fix

This commit is contained in:
Brian Fiete 2024-09-11 15:27:56 -04:00
parent 4af432955e
commit 04e67007dd
2 changed files with 13 additions and 1 deletions

View file

@ -1047,7 +1047,13 @@ namespace System.Reflection
{ {
if (fieldIdx > 0) if (fieldIdx > 0)
strBuffer.Append(", "); strBuffer.Append(", ");
GetType(mFieldDataPtr[fieldIdx].[Friend]mFieldTypeId).GetFullName(strBuffer); var fieldData = mFieldDataPtr[fieldIdx];
GetType(fieldData.[Friend]mFieldTypeId).GetFullName(strBuffer);
if (!fieldData.mName[0].IsNumber)
{
strBuffer.Append(' ');
strBuffer.Append(fieldData.mName);
}
} }
} }
else if ((mTypeFlags.HasFlag(.Splattable)) && (mFieldDataPtr != null)) else if ((mTypeFlags.HasFlag(.Splattable)) && (mFieldDataPtr != null))

View file

@ -6899,6 +6899,12 @@ BfIRValue BfModule::CreateTypeData(BfType* type, BfCreateTypeDataContext& ctx, b
reflectIncludeAllMethods = true; reflectIncludeAllMethods = true;
} }
if (typeInstance->IsTuple())
{
// Required to generate tuple name at runtime
reflectIncludeAllFields = true;
}
BfReflectKind reflectKind = BfReflectKind_Type; BfReflectKind reflectKind = BfReflectKind_Type;
auto _GetReflectUserFromDirective = [&](BfAttributeDirective* attributesDirective, BfAttributeTargets attrTarget) auto _GetReflectUserFromDirective = [&](BfAttributeDirective* attributesDirective, BfAttributeTargets attrTarget)