-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[ntuple] RNTuple error when serializing TClass typedef members #7861
Copy link
Copy link
Closed
Labels
Description
- Checked for duplicates
Describe the bug
TClass members which are typedefs of supported RNTuple types are not being resolved to their true types during serialization, which is causing runtime errors.
To Reproduce
Define a custom class with, e.g. a typedef'd std::string member intended to be serialized using rootcling and TClass
class CustomStruct {
typedef std::string typedef_string;
typedef_string str;
};
auto classField = RField<CustomStruct>("field");Trying to create this field fails at run time:
C++ exception with description "Field npos has unknown type const string::size_type (unchecked RResult access!)
At:
static ROOT::Experimental::RResult<std::unique_ptr<ROOT::Experimental::Detail::RFieldBase> >
ROOT::Experimental::Detail::RFieldBase::Create(const string&, const string&)
[/home/max/projects/rootdev/root/tree/ntuple/v7/src/RField.cxx:202]
Setup
ROOT master
Additional context
This is likely resolved by using GetTrueTypeName instead of GetFullTypeName here (thank you @jblomer):
root/tree/ntuple/v7/src/RField.cxx
Line 550 in 28f86b3
| auto subField = Detail::RFieldBase::Create(dataMember->GetName(), dataMember->GetFullTypeName()).Unwrap(); |
Reactions are currently unavailable