Project

General

Profile

Bug #11096

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

Problematic code 

 ~~~ruby 
 ~~~ 
 class A 
   def aa 
     self.bb ||= 0 
   end 

   private 

   def bb 
     1 
   end 
 end 

 A.new.aa 
 ~~~ 
 On 2.0 and 2.1 this produces 'NoMethodError: private method `bb' called for'. But since 2.2 this works and return '1'. Checked also on ruby-head from rvm. 
 This is similar #9907 but this allows to execute private methods by pretending that setter might be used.

Back