Project

General

Profile

Actions

Bug #12834

closed

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

Added by ndn (Nikola Nenkov) about 8 years ago. Updated about 4 years ago.

Status:
Closed
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

Like0
Like0Like0Like0Like0Like0Like0Like0