Actions
Bug #17590
closed`M.prepend M` has hidden side effect
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
Description
M.prepend M
raises ArgumentError, but it has hidden side effect.
module M; end
class C; end
C.prepend M
C.include M
M.prepend M rescue nil
module M2; end
M2.prepend M
C.include M2
p C.ancestors # => [M, C, M2, M, M2, Object, Kernel, BasicObject]
module M; end
class C; end
C.prepend M
C.include M
module M2; end
M2.prepend M
C.include M2
p C.ancestors # => [M, C, M2, Object, Kernel, BasicObject]
Actions
Like0
Like0Like0Like0