From: ndnenkov@... Date: 2016-10-13T15:42:48+00:00 Subject: [ruby-core:77614] [Ruby trunk Bug#12834] `prepend` getting prepended even if it already exists in the ancestors chain Issue #12834 has been updated by Nikola Nenkov. My point was that whether or not a module will get prepended can have an actual impact, yet it got changed between versions without an explicit notice. Given that the behaviour is documented as opposed to left undefined, I thought that this is a regression. ---------------------------------------- Bug #12834: `prepend` getting prepended even if it already exists in the ancestors chain https://bugs.ruby-lang.org/issues/12834#change-60882 * Author: Nikola Nenkov * Status: Open * Priority: Normal * Assignee: * ruby -v: 2.3.1 * Backport: 2.3: UNKNOWN ---------------------------------------- ``` 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]](https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/) and the [[documentation]](https://ruby-doc.org/core-2.3.1/Module.html#method-i-prepend_features) is now outdated. -- https://bugs.ruby-lang.org/ Unsubscribe: