[ruby-core:113756] [Ruby master Bug#19711] NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb

Issue #19711 has been reported by yahonda (Yasuo Honda). ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/

Issue #19711 has been updated by hsbt (Hiroshi SHIBATA). I reverted commit:bebd05fb51ea65bc57344b67100748200f8311eb at commit:3a4302c742622dda9fbaeeb90fd42364badc423d ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711#change-103402 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/

Issue #19711 has been updated by ioquatix (Samuel Williams). ```ruby module ActiveSupport class Deprecation include Singleton ``` Why is Rails trying to call `new` on a singleton class? What is the expected behaviour of calling new on a subclass of a Singleton? ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711#change-103404 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/

Issue #19711 has been updated by dpepper (Daniel Pepper). Looks like https://github.com/rails/rails/blob/main/activesupport/test/deprecation_test... calls `.new` on the Deprecation Singleton a bunch of places. This behavior _should_ not be possible on a singleton, however `.new` is explicitly marked as public in InstanceDelegator. ```ruby module ActiveSupport class Deprecation include Singleton include InstanceDelegator # <== ``` ```ruby module ActiveSupport class Deprecation module InstanceDelegator # :nodoc: def self.included(base) ... base.public_class_method :new # <== makes otherwise private method public again end ``` https://github.com/rails/rails/blob/main/activesupport/lib/active_support/de... Essentially, this is what's happening: ```ruby klass = Class.new do include Singleton public_class_method :new end Class.new(klass).new # <== used to work but explodes after the change ``` The Singleton PR inadvertently changed `.new` to be marked private in both included and inherited (priorly just the when included), hence `.new` was made private, public, then unexpectedly private again. I agree with ioquatix in wondering why `.new` is called on a singleton, but happy to scope down the Singleton change to avoid changing behavior until we want to do that explicitly. ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711#change-103406 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/

Issue #19711 has been updated by ioquatix (Samuel Williams). @yahonda do you have any opinion on Rails' usage as outlined above? ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711#change-103407 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/

Issue #19711 has been updated by byroot (Jean Boussier).
do you have any opinion on Rails' usage as outlined above?
Before even looking at the issue, we'll fix it if necessary, but we need advance notice first, otherwise this will cause a mess for people upgrading to 3.3. ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711#change-103409 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/

Issue #19711 has been updated by yahonda (Yasuo Honda). This code was added almost 10 years ago via https://github.com/rails/rails/commit/71993c6f9770b1350aa41fe8c68f1dd2c78004... and I have not found the reason why yet. My opinion is I also want some deprecation cycle before dropping this behavior. ---------------------------------------- Bug #19711: NoMethodError "private method `new' called for class" since bebd05fb51ea65bc57344b67100748200f8311eb https://bugs.ruby-lang.org/issues/19711#change-103410 * Author: yahonda (Yasuo Honda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Rails CI against ruby3.3.0dev has been failing https://buildkite.com/rails/rails/builds/96929#0188841c-cf1f-46d6-b48b-f510a... According to git bisect, this change has been triggered via bebd05fb51ea65bc57344b67100748200f8311eb ### Steps to reproduce (that may not be minimum though) ``` $ gem install activesupport $irb require 'active_support/deprecation' klass = Class.new(ActiveSupport::Deprecation) deprecator = klass.new ``` ### Expected behavior It should successfully work as the previous commit does. ``` $ ruby -v ruby 3.3.0dev (2023-06-02T21:16:52Z master 4e26ae3cb9) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007f683e01a5b0> irb(main):003:0> deprecator = klass.new => #<#<Class:0x00007f683e01a5b0>:0x00007f683e2207b0 ... irb(main):004:0> ``` ### Actual behavior It gets "(irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError)" ``` $ ruby -v ruby 3.3.0dev (2023-06-03T00:35:18Z master bebd05fb51) [x86_64-linux] $ gem install activesupport Successfully installed activesupport-7.0.5 Parsing documentation for activesupport-7.0.5 Done installing documentation for activesupport after 1 seconds 1 gem installed $ irb irb(main):001:0> require 'active_support/deprecation' => true irb(main):002:0> klass = Class.new(ActiveSupport::Deprecation) irb(main):003:0> deprecator = klass.new (irb):3:in `<main>': private method `new' called for class #<Class:0x00007f7e13282bc8> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):004:0> irb(main):003:0> require 'active_support/deprecation' => true irb(main):004:0> klass = Class.new(ActiveSupport::Deprecation) => #<Class:0x00007fbd57dd9b10> irb(main):005:0> deprecator = klass.new (irb):5:in `<main>': private method `new' called for class #<Class:0x00007fbd57dd9b10> (NoMethodError) from <internal:kernel>:187:in `loop' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/irb-1.7.0/exe/irb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `load' from /home/yahonda/.rbenv/versions/trunk/bin/irb:25:in `<main>' irb(main):006:0> -- https://bugs.ruby-lang.org/
participants (5)
-
byroot (Jean Boussier)
-
dpepper (Daniel Pepper)
-
hsbt (Hiroshi SHIBATA)
-
ioquatix (Samuel Williams)
-
yahonda (Yasuo Honda)