From: "jeremyevans0 (Jeremy Evans) via ruby-core" Date: 2026-12-03T06:55:19+00:00 Subject: [ruby-core:127811] [Ruby Bug#22708] UnboundMethod#inspect for ZSUPER method potentially shows undefined method since Ruby 3.2 Issue #22708 has been updated by jeremyevans0 (Jeremy Evans). >From further analysis, the change was due to #18798, but discussion in that bug did not consider ZSUPER methods. PR: https://github.com/ruby/ruby/pull/20434 ---------------------------------------- Bug #22708: UnboundMethod#inspect for ZSUPER method potentially shows undefined method since Ruby 3.2 https://bugs.ruby-lang.org/issues/22708#change-120406 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Starting in Ruby 3.2, `UnboundMethod#inspect` drops the class defining the ZSUPER method. `Method#inspect` always shows the class: ```ruby class C def c; 1 end end class SC < C alias sc c end p SC.instance_method(:sc) # Ruby 2.2-2.6: # # Ruby 2.7-3.1: # # Ruby 3.2-4.0: # p SC.new.method(:sc) # Ruby 2.2-2.6: # # Ruby 2.7-4.0: # ``` The `C#sc(c)` for Ruby 3.2-4.0 seems wrong to me, because `C#sc` is not defined (`SC#sc` is defined). I think we should restore the Ruby 2.7-3.1 behavior for `UnboundMethod#inspect`, making it consistent with `Method#inspect`. -- 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/