-
-
Notifications
You must be signed in to change notification settings - Fork 943
Closed
Milestone
Description
This issue comes from an error in Sinatra 2.2.0 when run on JRuby, due to the use of keyword-arg splatting, but has been reduced to eliminate Sinatra from the equation and merely compares MRI against JRuby.
Environment Information
Provide at least:
- JRuby version (
jruby -v) and command line (flags, JRUBY_OPTS, etc):jruby-9.3.0.0,jruby-9.2.19.0as built byruby-build - Operating system and platform (e.g.
uname -a):
Darwin limbo.lan 18.7.0 Darwin Kernel Version 18.7.0: Tue Jun 22 19:37:08 PDT 2021; root:xnu-4903.278.70~1/RELEASE_X86_64 x86_64
Other relevant info you may wish to add:
- Installed or activated gems: none
- Application/framework version (e.g. Rails, Sinatra) none
- Environment variables N/A
Expected Behavior
With the following minimal script to represent how successfully on MRI, without any of the Sinatra code:
def mew!
'MEOW'
end
def mew(*args, **kwargs, &bk)
mew!(*args, **kwargs, &bk)
end
puts mewMRI handles the zero-keyword call and routes through to the other method:
╭─{ yaauie@limbo:~/REDACTED }
╰─● (rbenv shell 2.7.2; ruby kwargs-splat.rb)
MEOW
[success]
Actual Behavior
JRuby raises an ArgumentError about arity mismatch:
╭─{ yaauie@limbo:~/REDACTED }
╰─● (rbenv shell jruby-9.3.0.0; ruby kwargs-splat.rb)
ArgumentError: wrong number of arguments (given 1, expected 0)
mew! at kwargs-splat.rb:2
mew at kwargs-splat.rb:7
<main> at kwargs-splat.rb:10
( rbenv shell jruby-9.3.0.0; ruby kwargs-splat.rb; ) 7.84s user 0.44s system 380% cpu 2.176 total
[error: 1]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels