-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
@jensnockert narrowed in this defect that happens to define_method usages with this strange usage of a block argument named _ combined with another argument called _.
Environment
- JRuby 9.1.6.0
- Operating system and platform: OS X,
Darwin Olles-MacBook-Pro.local 15.6.0 Darwin Kernel Version 15.6.0: Thu Sep 1 15:01:16 PDT 2016; root:xnu-3248.60.11~2/RELEASE_X86_64 x86_64
Expected Behavior
JRuby to output the same as MRI.
2.3.1 :001 > define_method(:a) { |*_, &_| puts "Trollolol!" }
:a
2.3.1 :002 > a
Trollolol!
nil
It also works in 9.1.5.0:
jruby-9.1.5.0 :003 > define_method(:a) { |*_, &_| puts "Trollolol!" }
:a
jruby-9.1.5.0 :004 > a
Trollolol!
nil
Actual Behavior
jruby-9.1.6.0 :004 > define_method(:a) { |*_, &_| puts "Trollolol!" }
=> :a
jruby-9.1.6.0 :005 > a
Java::JavaLang::RuntimeException: org.jruby.runtime.scopes.DynamicScope1 only supports scopes with 1 variables
from org.jruby.runtime.scopes.DynamicScope1.sizeError(Unknown Source)
from org.jruby.runtime.scopes.DynamicScope1.setValueVoid(Unknown Source)
from org.jruby.ir.interpreter.InterpreterEngine.setResult(InterpreterEngine.java:570)
from org.jruby.ir.interpreter.InterpreterEngine.setResult(InterpreterEngine.java:576)
from org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:187)
from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:111)
from org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
from org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
from org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:69)
from org.jruby.runtime.Block.call(Block.java:126)
from org.jruby.RubyProc.call(RubyProc.java:324)
from org.jruby.internal.runtime.methods.ProcMethod.call(ProcMethod.java:63)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:196)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
... 247 levels...
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:220)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:216)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:378)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:227)
from Users.olle.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_6_dot_0.bin.jruby_executable_hooks.invokeOther16:eval(/Users/olle/.rvm/gems/jruby-9.1.6.0/bin/jruby_executable_hooks:15)
from Users.olle.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_6_dot_0.bin.jruby_executable_hooks.RUBY$script(/Users/olle/.rvm/gems/jruby-9.1.6.0/bin/jruby_executable_hooks:15)
from java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
from org.jruby.ir.Compiler$1.load(Compiler.java:111)
from org.jruby.Ruby.runScript(Ruby.java:846)
from org.jruby.Ruby.runNormally(Ruby.java:761)
from org.jruby.Ruby.runNormally(Ruby.java:779)
from org.jruby.Ruby.runFromMain(Ruby.java:592)
from org.jruby.Main.doRunFromMain(Main.java:425)
from org.jruby.Main.internalRun(Main.java:313)
from org.jruby.Main.run(Main.java:242)
from org.jruby.Main.main(Main.java:204)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels