Project

General

Profile

Actions

Bug #12834

closed

`prepend` getting prepended even if it already exists in the ancestors chain

Added by ndn (Nikola Nenkov) over 5 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
2.3.1
Backport:
[ruby-core:77610]

Description

module M; end
class A; prepend M; end
class B < A; prepend M; end

B.ancestors # => [M, B, M, A, Object, Kernel, BasicObject]

Even though I find this behaviour to be more intuitive, it is inconsistent with Module#include and is potentially breaking.
I didn't see a mention on the [release notes] and the [documentation] is now outdated.

Actions

Also available in: Atom PDF