Project

General

Profile

Actions

Bug #14744

closed

Refinements modules have a superclass

Added by Eregon (Benoit Daloze) almost 6 years ago. Updated over 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
[ruby-core:86949]
Tags:

Description

$ ruby -e 'module M; refine Array do; p self; p self.class; p ancestors; end; end'
#<refinement:Array@M>
Module
[#<refinement:Array@M>, 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0