Skip to content

Tests for simplifying and normalizing types in sigs during translation #754

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

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

jesse-shopify
Copy link
Contributor

@jesse-shopify jesse-shopify commented Jun 6, 2025

Tests for normalization / simplification / flattening of

  • nested T.nilable
  • nested T.any
  • nested T.all

Requires RBI with Shopify/rbi#479

@jesse-shopify jesse-shopify self-assigned this Jun 6, 2025
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar marked this pull request as ready for review June 9, 2025 16:34
@Morriar Morriar requested a review from a team as a code owner June 9, 2025 16:34
@Morriar Morriar added the bugfix Fix a bug label Jun 9, 2025
def test_translate_to_rbs_with_nested_nilable_param
contents = <<~RB
Class.new do
sig { params(x: T.nilable(T.nilable(Integer))).void }
Copy link
Contributor

Choose a reason for hiding this comment

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

Is our logic for this purpose-built for RBS? This kind of normalization would be useful more generally. Would be nice to do: sig -> normalized sig -> RBS

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it's exactly what we did: Shopify/rbi#479

@jesse-shopify jesse-shopify merged commit 3f4b788 into main Jun 9, 2025
8 checks passed
@jesse-shopify jesse-shopify deleted the test-type-simplify-normalize branch June 9, 2025 20:38
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.

3 participants