Skip to content

Instantly share code, notes, and snippets.

@deepak
Created December 11, 2015 09:59
Show Gist options
  • Save deepak/51a93b576c2669b50412 to your computer and use it in GitHub Desktop.
Save deepak/51a93b576c2669b50412 to your computer and use it in GitHub Desktop.
prepend does not work with inheritance
# 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