From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2025-07-14T21:31:07+00:00 Subject: [ruby-core:122767] [Ruby Bug#21440] Cannot create instances of frozen Data subclasses Issue #21440 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ruby_3_4 commit:2af8f305542fd20537435046c1a558db5b2cacc5 merged revision(s) commit:2e7e78cd590d20aa9d41422e96302f3edd73f623. ---------------------------------------- Bug #21440: Cannot create instances of frozen Data subclasses https://bugs.ruby-lang.org/issues/21440#change-114046 * Author: jeremyevans0 (Jeremy Evans) * Status: Closed * Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ---------------------------------------- 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/