From: merch-redmine@... Date: 2019-08-12T22:23:50+00:00 Subject: [ruby-core:94312] [Ruby master Bug#11188] Method#inspect for chaining alias methods Issue #11188 has been updated by jeremyevans0 (Jeremy Evans). File method-inspect-chain-alias-11188.patch added I agree with ko1's opinion. Attached is a patch that implements his proposal. Note that this change cannot be made in `method_inspect`, because at that time, the necessary information has already been lost. To implement ko1's proposal, changes to `rb_alias` are required, so that the `defined_class` in the alias chain methods (`foo2` and `foo3`) is set correctly to `C0`. ---------------------------------------- Bug #11188: Method#inspect for chaining alias methods https://bugs.ruby-lang.org/issues/11188#change-80664 * Author: ko1 (Koichi Sasada) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: * ruby -v: 2.3dev * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- The following script prints strange results (at least for me). ```ruby class C0 def foo end end class C1 < C0 alias foo1 foo alias foo2 foo1 alias foo3 foo2 end p C1.new.method(:foo) p C1.new.method(:foo1) p C1.new.method(:foo2) p C1.new.method(:foo3) ``` Result: ``` # # # # ``` I believe 3rd and 4th results should be: ``` # # ``` How about it? ---Files-------------------------------- method-inspect-chain-alias-11188.patch (2.37 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: