-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Description
When marshalling and unmarshalling instances of Data classes in truffleruby 24.2.0-dev-49a44754, the attribute values are lost and become nil, though the object structure is preserved:
Klass = Data.define(:foo, :bar)
test = Klass.new(foo: 1, bar: 2)
loaded = Marshal.load(Marshal.dump(test))
test.foo # => 1
loaded.foo # => nil
test.bar # => 2
loaded.bar # => nil
Expected behavior: The loaded object should preserve the original instance attribute values.
TruffleRuby's test suite explicitly excludes this test with the message:
exclude :test_marshal, "<#<data TestData::Klass foo=1, bar=2>> expected but was <#<data TestData::Klass foo=nil, bar=nil>>."
Is this the intended behavior for marshalling Data objects?