Skip to content

Support for Inline RBS - #1173

Merged
castwide merged 54 commits into
masterfrom
inline-rbs
Jun 2, 2026
Merged

Support for Inline RBS#1173
castwide merged 54 commits into
masterfrom
inline-rbs

Conversation

@castwide

@castwide castwide commented Mar 4, 2026

Copy link
Copy Markdown
Owner

ref #1121

* Convert RBS implicit nil annotations

* Specs

* Linting

* Minor linting

* Documentation

* Typecheck fix
@castwide
castwide marked this pull request as ready for review May 20, 2026 00:21
@castwide

Copy link
Copy Markdown
Owner Author

This iteration supports two syntaxes:

# (short) method signatures

#: (Integer) -> String
def example(number); end

# class inheritance parameters

class Example < Array #[String]
end

@castwide
castwide merged commit 6d4d49d into master Jun 2, 2026
6 of 32 checks passed
castwide pushed a commit that referenced this pull request Aug 26, 2026
`parameters_from_inline_rbs` scanned the entire class body for
`#[...]`, so any bracketed comment in the body was read as the
superclass's type arguments. `# [:b, { c: :d }]` produced the
superclass name `Base<:b, { c: :d`, which resolves to nothing, and
every inherited method in the class then reported `Unresolved call` —
including on lines above the comment.

Match only where ruby/rbs's inline syntax puts it: directly after the
superclass, on the same line, `#[` with no space, with a closing `]`
required. `class Foo < Array # [String]` is now an ordinary comment.

Also removes a leftover debug `logger.warn` from
#1173.

Fixes #1300


Claude-Session: https://claude.ai/code/session_01NtwP1oKRXfJAbPQrPHm5oU

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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