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

Closed
axfcampos opened this Issue Nov 18, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@axfcampos

axfcampos commented Nov 18, 2016

Hey there 馃憢

Environment

Running jruby 9.1.6.0 (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)
end

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

Output in MRI 2.3.1:

1
2

Actual Behavior

Output in JRuby:

ArgumentError: missing keyword: b

@enebo enebo added this to the JRuby 9.1.7.0 milestone Nov 18, 2016

@flash-gordon

This comment has been minimized.

Show comment
Hide comment
@flash-gordon

flash-gordon 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 9.1.6.0 (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)

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 9.1.6.0 (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)

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Nov 30, 2016

Member

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...

Member

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 in 4e4935e Dec 2, 2016

@flash-gordon

This comment has been minimized.

Show comment
Hide comment
@flash-gordon

flash-gordon Dec 3, 2016

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

flash-gordon commented Dec 3, 2016

@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