From: "Eregon (Benoit Daloze)" Date: 2021-08-19T13:18:16+00:00 Subject: [ruby-core:105008] [Ruby master Bug#14744] Refinements modules have a superclass Issue #14744 has been updated by Eregon (Benoit Daloze). @matz Should `instance_method` and other methods magically find the method on the refined class, even though `self` is a Module though, like in https://bugs.ruby-lang.org/issues/14744#note-3 ? ---------------------------------------- Bug #14744: Refinements modules have a superclass https://bugs.ruby-lang.org/issues/14744#change-93408 * Author: Eregon (Benoit Daloze) * Status: Assigned * Priority: Normal * Assignee: shugo (Shugo Maeda) * ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- ~~~ $ ruby -e 'module M; refine Array do; p self; p self.class; p ancestors; end; end' # Module [#, Array, Enumerable, Object, Kernel, BasicObject] ~~~ So the refinement module (self in the `refine Array do` block) is a Module, but looking at its ancestors it has Array as a "superclass". Is that expected? I thought modules can never have a superclass in Ruby. -- https://bugs.ruby-lang.org/ Unsubscribe: