Issue #8127 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Closed


----------------------------------------
Bug #8127: NoMethodError for private / protected methods with Module#prepend
https://bugs.ruby-lang.org/issues/8127#change-37746

Author: dimko (Dmitriy Meremyanin)
Status: Closed
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]


=begin
Calling protected / private methods after using Module#prepend raises NoMethodError exception.
 
 module Foo
 end
 
 class Record
   prepend Foo
 
   def protected_method
   end
 
   protected :protected_method
 end
 
 record = Record.new
 record.respond_to?(:protected_method, true)  #=> true
 record.send(:protected_method)               #=> NoMethodError: undefined method `protected_method'
=end



-- 
http://bugs.ruby-lang.org/