Gate forwarding parameter syntax behind parser option - #3087
Merged
Conversation
`(...)` 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
force-pushed
the
claude/rbs-parameter-forwarding-aqywo6
branch
from
August 13, 2026 14:37
e159f2e to
78e4d68
Compare
This was referenced Aug 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#3042 added
(...)parsing, but nothing consumesTypes::Function#forwardingyet — the syntax has no type checking semantics, and Steep silently drops it. This gates it behindrbs_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.