Skip to content

Support forwarded arguments in calls, super, and nested blocks#416

Open
pvcresin wants to merge 2 commits intoruby:masterfrom
pvcresin:fix_forwarding_arguments
Open

Support forwarded arguments in calls, super, and nested blocks#416
pvcresin wants to merge 2 commits intoruby:masterfrom
pvcresin:fix_forwarding_arguments

Conversation

@pvcresin
Copy link
Copy Markdown
Contributor

@pvcresin pvcresin commented Apr 3, 2026

Known issue: forwarding-arguments

Summary

  • support argument forwarding with ... in direct calls, super(...), and nested blocks
  • move the forwarding-arguments case from known issues to regular scenarios
  • add scenario coverage for bar(...), super(...), and 1.times { bar(...) }

Design

  • model ... as forwarded actual arguments instead of reconstructing it from local variables
  • keep the forwarding state in a dedicated object referenced from LocalEnv
  • reuse the same forwarding state for super(...) and nested block bodies

Note

The implementation is based on the existing argument-binding logic in MethodDefBox#pass_arguments.

ForwardingArguments#accept_actual_arguments mirrors that flow to capture the actual arguments received by def foo(...), and ForwardingArguments#to_actual_arguments converts that captured state back into ActualArguments for direct calls, super(...), and nested block calls.

pvcresin and others added 2 commits April 3, 2026 12:27
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
@pvcresin pvcresin changed the title Support direct argument forwarding Support forwarded arguments in calls, super, and nested blocks Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant