Skip to content

Commit 16a90ef

Browse files
committed
[ntuple] fix streamer field with [U]Long64_t template arg
1 parent 4bf7473 commit 16a90ef

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tree/ntuple/src/RFieldMeta.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,10 @@ ROOT::RStreamerField::RStreamerField(std::string_view fieldName, TClass *classp)
10211021
fClass(classp),
10221022
fIndex(0)
10231023
{
1024+
std::string renormalizedAlias;
1025+
if (Internal::NeedsMetaNameAsAlias(classp->GetName(), renormalizedAlias))
1026+
fTypeAlias = renormalizedAlias;
1027+
10241028
fTraits |= kTraitTypeChecksum;
10251029
// For RClassField, we only check for explicit constructors and destructors and then recursively combine traits from
10261030
// all member subfields. For RStreamerField, we treat the class as a black box and additionally need to check for

tree/ntuple/test/rfield_class.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ TEST(RNTuple, TClassMetaName)
400400
auto f5 = std::make_unique<ROOT::RField<StructUsingCollectionProxy<Long64_t>>>("f");
401401
EXPECT_TRUE(dynamic_cast<ROOT::RProxiedCollectionField *>(f5.get()));
402402
EXPECT_EQ("StructUsingCollectionProxy<Long64_t>", f5->GetTypeAlias());
403+
404+
ROOT::RStreamerField f6("f", "EdmWrapper<long long>");
405+
EXPECT_STREQ("EdmWrapper<Long64_t>", f6.GetClass()->GetName());
406+
EXPECT_EQ("EdmWrapper<Long64_t>", f6.GetTypeAlias());
403407
}
404408

405409
TEST(RNTuple, StreamerInfoRecords)

0 commit comments

Comments
 (0)