Skip to content

Fix RBS syntax error#837

Merged
sferik merged 1 commit intohttprb:mainfrom
hakanensari:fix-rbs-void-union-syntax
Mar 20, 2026
Merged

Fix RBS syntax error#837
sferik merged 1 commit intohttprb:mainfrom
hakanensari:fix-rbs-void-union-syntax

Conversation

@hakanensari
Copy link
Contributor

@hakanensari hakanensari commented Mar 19, 2026

The newly-released RBS 4.0 rejects void in union types at the parser level. The (Integer | void) return type on Readable#rewind now causes a hard parse error.

Change to void, consistent with CompositeIO#rewind and the YARD @return annotation.

Copilot AI review requested due to automatic review settings March 19, 2026 21:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the RBS for HTTP::FormData::Readable#rewind to avoid an RBS 4.0 parser error caused by using void inside a union type, aligning the signature with Ruby’s IO#rewind/StringIO#rewind behavior.

Changes:

  • Replace def rewind: () -> (Integer | void) with def rewind: () -> Integer in HTTP::FormData::Readable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hakanensari hakanensari force-pushed the fix-rbs-void-union-syntax branch from 018980b to 6fda6fe Compare March 19, 2026 22:02
The newly-released RBS 4.0 rejects void in union types at the parser
level. The (Integer | void) return type on Readable#rewind now causes a
hard parse error.

Change to `void`, consistent with CompositeIO#rewind and the YARD
@return annotation.
@hakanensari hakanensari force-pushed the fix-rbs-void-union-syntax branch from 6fda6fe to b5301ca Compare March 19, 2026 22:04
@sferik sferik self-assigned this Mar 20, 2026
@sferik sferik added this to the v6.1.0 milestone Mar 20, 2026
@sferik
Copy link
Contributor

sferik commented Mar 20, 2026

Thanks for this patch! It looks like RBS for was released within just a few hours of v6.0.0/v6.0.1, so I wasn't able to test with it.

@sferik sferik merged commit 8e8eca9 into httprb:main Mar 20, 2026
8 checks passed
@sferik
Copy link
Contributor

sferik commented Mar 20, 2026

Planning to ship v6.0.2 with this change shortly.

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.

3 participants