Skip to content

[io] read versioned class from file even if in-memory-class is unversioned #18660

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

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

Conversation

ferdymercury
Copy link
Collaborator

@ferdymercury ferdymercury commented May 8, 2025

This Pull request:

Changes or fixes:

Fixes https://its.cern.ch/jira/browse/ROOT-5306

Reproducer:

root
.L /tmp/MySubClass.cxx+
TFile f("/tmp/mysub.root", "RECREATE");
MySubClass msc;
msc.id = 33;
f.WriteObjectAny(&msc, "MySubClass", "msc");
f.Close();
.q
root
.L /tmp/MySubClassUnv.cxx+
auto file = TFile::Open("/tmp/mysub.root", "READ");
auto msc = file->Get<MySubClass>("msc")
(msc->id == 33)
.q

with MySubClass.cxx

class MySubClass { public: int id; ClassDef(MySubClass, 3) };

and MySubClassUnv.cxx

class MySubClass { public: int id; };

Checklist:

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

@ferdymercury ferdymercury marked this pull request as ready for review May 8, 2025 09:51
@ferdymercury ferdymercury requested a review from pcanal as a code owner May 8, 2025 09:51
@ferdymercury ferdymercury requested a review from bellenot as a code owner May 8, 2025 11:34
Copy link

github-actions bot commented May 8, 2025

Test Results

    18 files      18 suites   4d 2h 4m 6s ⏱️
 2 739 tests  2 728 ✅ 0 💤 11 ❌
47 931 runs  47 920 ✅ 0 💤 11 ❌

For more details on these failures, see this check.

Results for commit 1aada00.

♻️ This comment has been updated with latest results.

as suggested by pcanal
@ferdymercury ferdymercury requested a review from dpiparo as a code owner May 8, 2025 21:03
@ferdymercury ferdymercury requested a review from pcanal May 9, 2025 06:37
@ferdymercury ferdymercury added this to the 6.38.00 milestone May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants