From: matz@... Date: 2020-12-22T01:56:54+00:00 Subject: [ruby-core:101618] [Ruby master Bug#17423] `Prepend` should prepend a module before the class Issue #17423 has been reported by matz (Yukihiro Matsumoto). ---------------------------------------- Bug #17423: `Prepend` should prepend a module before the class https://bugs.ruby-lang.org/issues/17423 * Author: matz (Yukihiro Matsumoto) * Status: Open * Priority: Normal * Assignee: jeremyevans0 (Jeremy Evans) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- I see ```ruby module M; end module A; end class B; include A; end A.prepend M B.prepend M p B.ancestors ``` gives `[B, M, A, Object, Kernel, BasicObject]` now. It used to be `[M, B, A, Object, Kernel, BasicObject]`. I think it should be prepended to class `B`. Probably it should be `[M, B, M, A, Object, Kernel, BasicObject]`. The reason behind this change may be duplication removing, but considering the following code, it is OK to duplicate prepende modules. ```ruby module M; end class A; end class B [M, B, M, A, Object, Kernel, BasicObject] ``` Am I missing something? Matz. -- https://bugs.ruby-lang.org/ Unsubscribe: