Skip to content

Calls inside a ... method use the method's caller's keyword flags (regression in 10.1.3.0) #10115

Closed as duplicate

Description

@timriley

Environment Information

  • JRuby version: jruby 10.1.3.0 (4.0.9) 2026-11-05 3db52d02f9 OpenJDK 64-Bit Server VM 25.0.1+8-27 on 25.0.1+8-27 +indy +jit [arm64-darwin]
  • Command line: jruby repro.rb (no flags, JRUBY_OPTS not set)
  • Operating system: macOS 27.0.1 (Darwin 27.0.0 arm64)
  • Installed gems: none needed for the repro script
  • Also seen on jruby-head (5092a0d) on Ubuntu 24.04, per Tests are failing on jruby-head dry-rb/dry-auto_inject#101

This appears to be a regression from 5ca404d. JRuby 10.1.2.0 is not affected.

Expected Behavior

In a method that has a ... parameter, a call in the body that does not forward ... should get its own keyword arguments as keywords.

def target(a, x:) = [a, x]

def forwarder(...) = target(1, x: 2)

p forwarder

CRuby 3.4.7 and JRuby 10.1.2.0 print:

[1, 2]

Actual Behavior

JRuby 10.1.3.0 passes x: 2 to target as a positional hash:

ArgumentError: wrong number of arguments (given 2, expected 1)
     target at repro.rb:1
  forwarder at repro.rb:3
     <main> at repro.rb:5

It looks like every call in the body of a ... method gets the keyword flags of the outer method's caller. Here forwarder is called with no keywords, so the call to target is also treated as having no keywords.

Impact

I'm reporting this because it breaks the current releases of dry-auto_inject, dry-types, dry-monads, and Hanami. This means you cannot run Hanami apps on 10.1.3.0, nor any app depending on those Dry libraries.

To illustrate this in dry-auto_inject's case: it has a Builder#method_missing(name, ...) that calls Injector.new(container, strategies[name], builder: self). On 10.1.3.0, Injector#initialize(container, strategy, builder:) gets builder: self as a third positional argument instead of a real keyword argument.

We can see this when running the dry-auto_inject test suite locally with JRuby 10.1.3.0. You'll see >50 failures, all with wrong number of arguments (given 3, expected 2). See dry-rb/dry-auto_inject#101.

For now I've prepared dry-rb/dry-auto_inject#102 that works around this issue, but I wanted to make sure we could get this report shared upstream to you as well :)

Activity

  1. timriley commented on Nov 18, 2026

    @timriley
    Author

    I see this is a dup of #10026. I'll close this one now, sorry for the extra noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions