Actions
Bug #21440
closedCannot create instances of frozen Data subclasses
Bug #21440:
Cannot create instances of frozen Data subclasses
Description
This fails since Data was added in Ruby 3.2:
Class.new(Data.define(:a)).freeze.new
# can't modify frozen #<Class:#<Class:0x000079cf41253160>>: #<Class:0x000079cf41253160> (FrozenError)
Note that the error occurs even before the ArgumentError due to the missing argument to new.
This doesn't happen on classes created with Data.define (only subclasses of those classes):
Data.define(:a).freeze.new
# missing keyword: :a (ArgumentError)
Actions