Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

JRuby can not interpret keyword argument when placed after positional argument in block #4319

axfcampos opened this issue Nov 18, 2016 · 3 comments


Copy link

Hey there 馃憢


Running jruby (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 [darwin-x86_64] on Darwin axfcampos.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64

Expected Behavior

Example code:

def hello
  yield(1, b: 2)

hello do |a, b:|
  puts a, b

Output in MRI 2.3.1:


Actual Behavior

Output in JRuby:

ArgumentError: missing keyword: b
@enebo enebo added this to the JRuby milestone Nov 18, 2016
Copy link

flash-gordon commented Nov 27, 2016

I came across the same issue, though I can't reproduce it with your example. For me it fails with

ruby -e "proc { |_, a:| }.call(1, a: 1)"

Because of it I got a couple of pending examples in one of my gems.

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

jruby (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]

macOS Sierra 10.12.2 Beta (16C48b)

Copy link

enebo commented Nov 30, 2016

I spent some time on this and will try and get something on this shortly but this is not broken once the code is JITed. Both interp and full interp fail but that makes sense since they both use the same code. I am confused though. I was fairly certain the JIT called through the same method as well. So something in JIT changes this behavior...

@enebo enebo closed this as completed in 4e4935e Dec 2, 2016
Copy link

@enebo I checked my case on JRuby's master and it works fine, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants