[ruby-core:122523] [Ruby Bug#21440] Cannot create instances of frozen Data subclasses

Issue #21440 has been reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Bug #21440: Cannot create instances of frozen Data subclasses https://bugs.ruby-lang.org/issues/21440 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.2: REQUIRED, 3.3: REQUIRED, 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/

Issue #21440 has been updated by nobu (Nobuyoshi Nakada). Also `Class.new(Struct.new(:a)).freeze.new`. ---------------------------------------- Bug #21440: Cannot create instances of frozen Data subclasses https://bugs.ruby-lang.org/issues/21440#change-113748 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.2: REQUIRED, 3.3: REQUIRED, 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/

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/

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 #<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/
participants (4)
-
jeremyevans0 (Jeremy Evans)
-
k0kubun (Takashi Kokubun)
-
nagachika (Tomoyuki Chikanaga)
-
nobu (Nobuyoshi Nakada)