Project

General

Profile

Actions

Bug #6654

closed

Module#prepend does not honor included modules

Added by rkh (Konstantin Haase) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
Backport:
[ruby-core:45914]

Description

=begin
I really love that Module#prepend landed in core. I just had a play with it. I'm not sure if the following behavior is intentional:

module A
  def a; end
end

module B
  include A
  def b; end
end

class C
  prepend B
end


p C.new.respond_to? :b # true
p C.new.respond_to? :a # false (expected true)

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0