[#107430] [Ruby master Feature#18566] Merge `io-wait` gem into core IO — "byroot (Jean Boussier)" <noreply@...>
Issue #18566 has been reported by byroot (Jean Boussier).
22 messages
2022/02/02
[ruby-core:107723] [Ruby master Bug#18600] Aliased method visibility issue on Ruby 3.1
From:
"gmcgibbon (Gannon McGibbon)" <noreply@...>
Date:
2022-02-22 21:03:22 UTC
List:
ruby-core #107723
Issue #18600 has been updated by gmcgibbon (Gannon McGibbon). It seems methods on classes that were originally private in the parent and made public in the child can no longer be aliased correctly: ``` class C public :system alias_method :bar, :system alias_method :system, :bar end p RUBY_VERSION p [C.new.respond_to?(:system), C.new.respond_to?(:system, true)] ``` On Ruby <= 3.0.3, this returns `[true, true]`, but on Ruby >= 3.1.0 this returns `[false, true]`. The aliased method seems to revert visibility to the parent. May be related to https://github.com/ruby/ruby/pull/4149. ---------------------------------------- Bug #18600: Aliased method visibility issue on Ruby 3.1 https://bugs.ruby-lang.org/issues/18600#change-96645 * Author: gmcgibbon (Gannon McGibbon) * Status: Open * Priority: Normal * ruby -v: 3.1.0 * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- It seems methods on classes that were originally private in the parent and made public in the child can no longer be aliased correctly: ``` class C public :system alias_method :bar, :system alias_method :system, :bar end p RUBY_VERSION p [C.new.respond_to?(:system), C.new.respond_to?(:system, true)] ``` On Ruby <= 3.0.3, this returns `[true, true]`, but on Ruby >= 3.1.0 this returns `[false, true]`. The aliased method seems to revert visibility to the parent. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>