Actions
Bug #10283
closedCalling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via send
Description
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.
Actions
Like0
Like0Like0Like0Like0Like0