Created
December 11, 2015 09:59
-
-
Save deepak/51a93b576c2669b50412 to your computer and use it in GitHub Desktop.
prepend does not work with inheritance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14] | |
# from https://bugs.ruby-lang.org/issues/11301 | |
module M | |
end | |
class A | |
prepend M | |
end | |
p A.ancestors # => [M, A, Object, Kernel, BasicObject] | |
class B < A | |
prepend M | |
end | |
p B.ancestors # => [B, M, A, Object, Kernel, BasicObject] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment