Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ntuple] Fix RClassField not resolving context-dependent typedefs #17783

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

silverweed
Copy link
Contributor

This Pull request:

With #17637 we started using TDataMember::GetFullTypeName() for the type name of RClassField's subfields, relying on later type renormalization. However, this approach fails when the type in question cannot be looked up by TClass::GetClass because it's context dependent (e.g. a templated typedef inside a class).
This PR goes back to use TDataMember::GetTrueTypeName() instead, and assigns the FullTypeName to the type alias of the created subfield. This allows handling cases of context-dependent typedefs, as we use the already-resolved type when creating the subfield.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #17774

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link

github-actions bot commented Feb 20, 2025

Test Results

    18 files      18 suites   4d 8h 24m 49s ⏱️
 2 719 tests  2 719 ✅ 0 💤 0 ❌
47 253 runs  47 253 ✅ 0 💤 0 ❌

Results for commit a246042.

♻️ This comment has been updated with latest results.

Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Philippe, we should verify that the fields (including class member fields) have the expected type names and aliases. Maybe this should go to tree/ntuple/v7/test/ntuple_type_name.cxx though and we keep ntuple_types.cxx about being able to write and read the data.

@silverweed silverweed force-pushed the ntuple_fix_field_typenorm branch from a9a95c1 to 8c72814 Compare February 21, 2025 10:00
We are currently using GetFullTypeName (aka the unresolved type of the
field) and relying on later type
renormalization, but this will fail to lookup the proper type in
RFieldBase::Create() when the type is a context-dependent type, like
a templated typedef contained inside a class.

With this commit, we instead use the already-resolved type
(TDataMember::GetTrueTypeName()) to create the field and then assign
the type alias manually to the FullTypeName
@silverweed silverweed force-pushed the ntuple_fix_field_typenorm branch from 8c72814 to a246042 Compare February 21, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ntuple] ATLAS RNTuple Writing Issue (2025-02-19)
3 participants