root icon indicating copy to clipboard operation
root copied to clipboard

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

Open ferdymercury opened this issue 7 months ago • 2 comments

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:

  • [x] tested changes locally
  • [x] updated the docs (if necessary)

ferdymercury avatar May 08 '25 09:05 ferdymercury

Test Results

    22 files      22 suites   3d 19h 47m 13s ⏱️  3 702 tests  3 701 ✅ 0 💤 1 ❌ 79 511 runs  79 510 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit c82eba25.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 08 '25 20:05 github-actions[bot]

@pcanal gentle reminder to 'squash on merge' (if you approve).

ferdymercury avatar Aug 29 '25 18:08 ferdymercury