Project

General

Profile

Bug #10283

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

This raises a NoMethodError in ruby 2.2.0preview1: 

     

   ruby -e "class A; define_method('b='.to_sym){|v|}; end; A.new.b = 1" 

 This does not, showing it is specific to dynamic symbols: 

     

   ruby -e "class A; define_method(:b=){|v|}; end; A.new.b = 1" 

 This does not, showing it is specific to symbols ending in =: 

     

   ruby -e "class A; define_method('b'.to_sym){}; end; A.new.b" 

 This does not, showing it works when called via send: 

     

   ruby -e "class A; define_method('b='.to_sym){|v|}; end; A.new.send(:b=, 1)" 

 This does not, showing it works after calling send: 

     

   ruby -e "class A; define_method('b='.to_sym){|v|}; end; A.new.send(:b=, 1); A.new.b = 1" 

 I apologize if this is already fixed in trunk.

Back