Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
NullPointerException when trying to assign UnboundMethod using define_method & to_proc #2426
Stumbled upon this earlier when I used
class B define_singleton_method :new, &Class.instance_method(:new) end
Just a note this is broken on 1.7 and master. The error above is a mild red herring in that the error message we should throw happens in evaluating define_singleton_method and this stack is us trying to execute the method we erroneously added (by calling B.new after this class body)
The bug is in coercion using &. It should kick out the unbound method. Investigating.