Skip to content

Calling method_missing with only Kwargs passes arguments incorrectly #6304

@petekinnecom

Description

@petekinnecom

Example:

class Thing
  def method_missing(*a, **b)
    [a, b]
  end
end

Thing.new.undefined_method(a: 1, b: 2)
# => [[:undefined_method], [:undefined_method]]

It seems the args are not correctly passed to method missing, however, if there are any positional args, it works fine. I've added on to make a failing test case you can see here:

petekinnecom@509590c

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions