-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Having the following test.rb script:
class Foo
def test(foo:)
yield(foo: foo + 1)
end
end
args = []
kwargs = { foo: 10 }
Foo.new.public_send("test", *args, **kwargs) do |*sub_args, **sub_kwargs|
puts "test"
puts sub_args.inspect
puts sub_kwargs.inspect
end
The following happens with jruby 9.4.0.0: as you can see, the keyword argument { foo: 11 } is catched in sub_args instead of sub_kwargs
14:02 $ ruby -v
jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 11.0.17+8-post-Ubuntu-1ubuntu222.04 on 11.0.17+8-post-Ubuntu-1ubuntu222.04 +jit [x86_64-linux]
14:02 $ ruby test.rb
test
[{:foo=>11}]
{}
This does not happen on ruby MRI 3.1.2:
14:04 $ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
ruby test.rb
test
[]
{:foo=>11}
``
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels