Project

General

Profile

Actions

Bug #11301

closed

Module#prepend should have always added the module before the current

Added by matz (Yukihiro Matsumoto) almost 9 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:69722]

Description

I don't think it's ideal:

module M
end  

class A
  prepend M
end  

A.ancestors
# => [M, A, Object, PP::ObjectMixin, Kernel, BasicObject]

class B<A
  prepend M
end  
B.ancestors
# => [B, M, A, Object, PP::ObjectMixin, Kernel, BasicObject]

It should be either error (for not adding module) or the module appearing multiple times,
i.e. B.ancestors to be

[M, B, M, A, Object, PP::ObjectMixin, Kernel, BasicObject]

Matz.

Actions

Also available in: Atom PDF

Like0
Like0Like0