From 04e67007dd0ec0ad9a279309a0105400290b6ad9 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 11 Sep 2024 15:27:56 -0400 Subject: [PATCH] Tuple reflected name fix --- BeefLibs/corlib/src/Type.bf | 8 +++++++- IDEHelper/Compiler/BfModule.cpp | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/Type.bf b/BeefLibs/corlib/src/Type.bf index c8ea0d8e..4101cc93 100644 --- a/BeefLibs/corlib/src/Type.bf +++ b/BeefLibs/corlib/src/Type.bf @@ -1047,7 +1047,13 @@ namespace System.Reflection { if (fieldIdx > 0) 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)) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 612f92d6..e8d6b1c6 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -6899,6 +6899,12 @@ BfIRValue BfModule::CreateTypeData(BfType* type, BfCreateTypeDataContext& ctx, b reflectIncludeAllMethods = true; } + if (typeInstance->IsTuple()) + { + // Required to generate tuple name at runtime + reflectIncludeAllFields = true; + } + BfReflectKind reflectKind = BfReflectKind_Type; auto _GetReflectUserFromDirective = [&](BfAttributeDirective* attributesDirective, BfAttributeTargets attrTarget)