-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Stumbled upon this earlier when I used define_singleton_method incorrectly.
Code:
class B
define_singleton_method :new, &Class.instance_method(:new)
endMRI:
./t.rb:2:in `<class:B>': wrong argument type UnboundMethod (expected Proc) (TypeError)
from ./t.rb:1:in `<main>'
JRuby:
RubyClass$INVOKER$i$newInstance.gen:-1:in `call': java.lang.NullPointerException
from RubyMethod.java:194:in `call'
from CompiledBlock19.java:158:in `yield'
from CompiledBlock19.java:87:in `call'
from Block.java:106:in `call'
from RubyProc.java:301:in `call'
from ProcMethod.java:64:in `call'
from DynamicMethod.java:202:in `call'
from DynamicMethod.java:198:in `call'
from CachingCallSite.java:297:in `cacheAndCall'
from CachingCallSite.java:135:in `call'
from ./t.rb:-1:in `invokeOther2:new'
from ./t.rb:5:in `__script__'
from MethodHandle.java:636:in `invokeWithArguments'
from Compiler.java:112:in `load'
from Ruby.java:811:in `runScript'
from Ruby.java:804:in `runScript'
from Ruby.java:755:in `runNormally'
from Ruby.java:565:in `runFromMain'
from Main.java:405:in `doRunFromMain'
from Main.java:300:in `internalRun'
from Main.java:227:in `run'
from Main.java:199:in `main'
Reactions are currently unavailable