-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
JRuby seems to get confused about method arity in some situation involving blocks and Enumerator.
I encountered this and have pared the code that triggers it down to this:
class BlockHolder
def initialize(block)
@block = block
end
def call(*a, **kw)
@block.call(*a, **kw)
end
end
class S
def initialize
to_enum(:call_via_blockholder).to_a
end
def call_via_blockholder(&block)
BlockHolder.new(block).call
end
end
def passkw(kw: )
end
passkw(kw: S.new)- JRuby version: jruby 9.4.8.0 (3.1.4) 2024-07-02 4d41e55 OpenJDK 64-Bit Server VM 17.0.5+8 on 17.0.5+8 +jit [x86_64-darwin]
- also reproduces on 9.4.2.0
- Operating system: consistent on macos and ubuntu
Expected Behavior: no error (passes on mri, truffleruby)
Actual Behavior: ArgumentError: wrong number of arguments (given 1, expected 0)
passkw at test.rb:21
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels