
Issue #21440 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED ruby_3_3 commit:a976792832887ee2ae1380ab0e2244067126f017 merged revision(s) commit:2e7e78cd590d20aa9d41422e96302f3edd73f623. ---------------------------------------- Bug #21440: Cannot create instances of frozen Data subclasses https://bugs.ruby-lang.org/issues/21440#change-113855 * Author: jeremyevans0 (Jeremy Evans) * Status: Closed * Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED ---------------------------------------- This fails since Data was added in Ruby 3.2: ```ruby 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): ```ruby Data.define(:a).freeze.new # missing keyword: :a (ArgumentError) ``` -- https://bugs.ruby-lang.org/