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

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r36241.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


prepend: fix ancestors order

Actions

Also available in: Atom PDF

Like0
Like0