Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RBS translation of attr_writer signatures #399

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Jan 14, 2025

I found some occurrences where the RBI signature for attribute writers where using a different type for the parameter and the return:

sig { params(baz: String).returns(T.nilable(String)) }
attr_writer :x

In this case Sorbet would only consider the return type so we need to keep this information during the translation to RBS:

attr_writer x: String?

@Morriar Morriar added the bugfix Fix a bug label Jan 14, 2025
@Morriar Morriar self-assigned this Jan 14, 2025
@Morriar Morriar requested a review from a team as a code owner January 14, 2025 21:42
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar force-pushed the at-rbs-attr-writer branch from 04ac883 to 5f50fe0 Compare January 15, 2025 16:20
@Morriar Morriar merged commit f635d47 into main Jan 15, 2025
8 checks passed
@Morriar Morriar deleted the at-rbs-attr-writer branch January 15, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants