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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyword arguments incompatibility #2518

jnicklas opened this issue Jan 25, 2015 · 1 comment · Fixed by #2540

Keyword arguments incompatibility #2518

jnicklas opened this issue Jan 25, 2015 · 1 comment · Fixed by #2540


Copy link

jnicklas commented Jan 25, 2015

This seems somewhat related to #2512, and may even be caused by the same problem, but it causes a a different problem, so I thought I'd report it separately.

Offending code looks like this:

def call_block(&block)"foo", bar: "quox")

call_block { |foo, bar:| puts bar }

On MRI this correctly produces the string "quox", but on JRuby (master), this produces an error like this:

ArgumentError: missing keyword: bar
          call at org/jruby/
  call_block_1 at test.rb:2
    __script__ at test.rb:5

Interestingly, omitting the first parameter to the block (foo in the example above) makes the code run without problem. The following correctly prints "quox" on JRuby master:

def call_block(&block) "quox")

call_block { |bar:| puts bar }
Copy link

jnicklas commented Jan 30, 2015

Awesome! :D

@enebo enebo added this to the milestone Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging a pull request may close this issue.

2 participants