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

Generate the right signature for generics with fixed type members #1151

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

rafaelfranca
Copy link
Member

Motivation

When a generic has a fixed type member, Sorbet doesn't accept it as argument in the #[] method, so we can't be passing T.untyped as argument.

Implementation

I filtered all the type variables that didn't had :fixed as key in the bounds arguments when generating the signature.

@rafaelfranca rafaelfranca requested a review from a team as a code owner September 8, 2022 20:04
@rafaelfranca rafaelfranca force-pushed the rm-fixed-type-member branch 3 times, most recently from 74dbefa to 7e082c8 Compare September 8, 2022 20:12
When a generic has a fixed type member, Sorbet doesn't accept it as
argument in the `#[]` method, so we can't be passing `T.untyped` as
argument.
Copy link
Member

@paracycle paracycle left a comment

Choose a reason for hiding this comment

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

Nice, thank you.

@rafaelfranca rafaelfranca merged commit 13a6ec5 into main Sep 8, 2022
@rafaelfranca rafaelfranca deleted the rm-fixed-type-member branch September 8, 2022 20:34
@shopify-shipit shopify-shipit bot temporarily deployed to production September 29, 2022 19:17 Inactive
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