From a9b72fd53529a679f0ab2dd01eadc70e009ab2d1 Mon Sep 17 00:00:00 2001 From: Philippe Canal Date: Thu, 21 Nov 2024 21:48:09 -0600 Subject: [PATCH] io: Workaround TDataType legacy type for enums (part2) --- io/io/src/TStreamerInfo.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/io/io/src/TStreamerInfo.cxx b/io/io/src/TStreamerInfo.cxx index 779118cdd37da..098809d6666fc 100644 --- a/io/io/src/TStreamerInfo.cxx +++ b/io/io/src/TStreamerInfo.cxx @@ -532,6 +532,7 @@ void TStreamerInfo::Build(Bool_t isTransient) if (auto enumdesc = TEnum::GetEnum(dm->GetFullTypeName(), TEnum::kNone)) { // NOTE: We might simplify this by having the dm->fDataType being 'correct'. + // If we do we need to also make sure to update the old type accordingly element->SetNewType(enumdesc->GetUnderlyingType()); element->SetType(TStreamerInfo::kInt); } @@ -2186,6 +2187,13 @@ void TStreamerInfo::BuildOld() // All the values of EDataType have the same semantic in EReadWrite newType = (EReadWrite)theType->GetType(); } + if (dm->IsEnum()) { + if (auto enumdesc = TEnum::GetEnum(dm->GetFullTypeName(), TEnum::kNone)) + { + // NOTE: We might simplify this by having the dm->fDataType being 'correct'. + newType = enumdesc->GetUnderlyingType(); + } + } if ((newType == ::kChar_t) && dmIsPtr && !isArray && !hasCount) { newType = ::kCharStar; } else if (dmIsPtr) {