From: shevegen@...
Date: 2018-05-08T20:42:11+00:00
Subject: [ruby-core:86950] [Ruby trunk Bug#14744] Refinements modules have a	superclass

Issue #14744 has been updated by shevegen (Robert A. Heiler).


> I thought modules can never have a superclass in Ruby.

This may be a bug, I think; other modules do not seem to have
anything but themselves if you call .ancestors() on them either.

----------------------------------------
Bug #14744: Refinements modules have a superclass
https://bugs.ruby-lang.org/issues/14744#change-71915

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* 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'
#<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.



-- 
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>