From: Dion Mendel Date: 2010-12-01T22:24:23+09:00 Subject: [ruby-core:33506] [Ruby 1.9-Bug#4106][Open] 1.9.2 regression - invoking protected singleton methods Bug #4106: 1.9.2 regression - invoking protected singleton methods http://redmine.ruby-lang.org/issues/show/4106 Author: Dion Mendel Status: Open, Priority: Normal Category: core ruby -v: ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux] Issue: Invoking a method that has been made protected in an object's singleton class fails with NoMethodError: protected method `xxxx' called. Invoking this protected method succeeds in 1.8.7 and 1.9.1. Relevant code snippet: class < a protected :meth end Test case: In 1.8.7 and 1.9.1, code will output "method called" In 1.9.2 code raises NoMethodError test.rb:13:in `test': protected method `meth' called for # ---- class A def meth puts 'method called' end def test a = A.new class << a protected :meth end a.meth # fails in 1.9.2 end end a = A.new a.test ---------------------------------------- http://redmine.ruby-lang.org