Project

General

Profile

Actions

Bug #6658

closed

Module#ancestors & prepend

Added by marcandre (Marc-Andre Lafortune) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
r36240
Backport:
[ruby-core:45919]

Description

Wouldn't it be best if Module#ancestors returned the modules & classes in the order they will be looked at?

Currently:

module M; end
class C; prepend M; end
C.ancestors # => [C, M, Class, Object, Kernel, BasicObject]
 # even though actual lookup order is [M, C, Class, Object, Kernel, BasicObject]

Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #6659: prepend した Class/Module の ancestors に Class が混入するRejectednobu (Nobuyoshi Nakada)06/28/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0