From: "nagachika (Tomoyuki Chikanaga) via ruby-core" Date: 2025-06-29T03:30:03+00:00 Subject: [ruby-core:122616] [Ruby Bug#21440] Cannot create instances of frozen Data subclasses 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 #>: # (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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/