Skip to content

Gate forwarding parameter syntax behind parser option - #3087

Merged
soutaro merged 2 commits into
masterfrom
claude/rbs-parameter-forwarding-aqywo6
Aug 13, 2026
Merged

Gate forwarding parameter syntax behind parser option#3087
soutaro merged 2 commits into
masterfrom
claude/rbs-parameter-forwarding-aqywo6

Conversation

@soutaro

@soutaro soutaro commented Aug 13, 2026

Copy link
Copy Markdown
Member

#3042 added (...) parsing, but nothing consumes Types::Function#forwarding yet — the syntax has no type checking semantics, and Steep silently drops it. This gates it behind rbs_parser_options_t: off by default, not exposed to the public Ruby API, so (...) stays a syntax error until the semantics are settled. #3042 is unreleased, so nothing depends on it.

The private _parse_* entry points take the flag so tests still cover the enabled path. AST, serializers, and schemas are unchanged.

claude added 2 commits August 13, 2026 12:24
`(...)` forwarding parameters (#3042) are syntax-only for now: nothing
defines their type checking semantics yet, and distributing signatures
that use them would break older parsers and tools that silently drop
the node.

Introduce `rbs_parser_options_t` and `rbs_parser_new_with_options()` so
the syntax must be opted into at the C API level. `rbs_parser_new()`
uses the zero-initialized options, which disable every optional syntax,
and the Ruby API doesn't expose the option, so `(...)` is a syntax
error everywhere in the gem. The AST, types, and serialization support
stays in place for when the semantics are settled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015bgoC4byczqmYRzNrDkVrL
Gating `(...)` behind a C-level option left the enabled path with no
test coverage from Ruby, where the whole suite lives. Without it the
forwarding branch of `parse_params`, its AST translation, and its
serialization would be free to rot until the semantics are settled.

Thread the option through the private `_parse_method_type` and
`_parse_signature` entry points (and their `_to_bytes` variants), which
tests already call directly. The public `RBS::Parser` API keeps passing
`false`, so signatures written for the gem still can't use the syntax.

This also strengthens the restriction tests: they used to pass simply
because the gate rejected `(...)` outright, and now run with the option
enabled, so they check the grammar restrictions they name.

The WebAssembly parser has no way to enable the option, so its shim
raises `NotImplementedError` rather than quietly parsing without it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015bgoC4byczqmYRzNrDkVrL
@soutaro
soutaro force-pushed the claude/rbs-parameter-forwarding-aqywo6 branch from e159f2e to 78e4d68 Compare August 13, 2026 14:37
@soutaro
soutaro added this pull request to the merge queue Aug 13, 2026
Merged via the queue into master with commit 314df26 Aug 13, 2026
24 of 25 checks passed
@soutaro
soutaro deleted the claude/rbs-parameter-forwarding-aqywo6 branch August 13, 2026 14:43
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.

2 participants