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

Infer lambda return types #7741

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Infer lambda return types #7741

wants to merge 3 commits into from

Conversation

jez
Copy link
Collaborator

@jez jez commented Mar 1, 2024

Motivation

Partial fix for #3914
Partial fix for #4149

Test plan

@jez
Copy link
Collaborator Author

jez commented Mar 1, 2024

We have a policy of testing changes to Sorbet against Stripe's codebase before
merging them. I've kicked off a test run for the current PR. When the build
finishes, I'll share with you whether or how it failed. Thanks!

Stripe employees can see the build results here:

https://go/builds/bui_PewZ5mTLBbaHfA
https://go/builds/bui_PewZb67f04mNoS
https://go/builds/bui_PewZQ4Ia9XSrcA

jez added a commit that referenced this pull request Apr 25, 2024
Sometimes it's useful to be able to use the arity of the block to guess
an overload.

This isn't perfect for all the reasons that overload checking isn't
perfect, but there are some places where this is useful, especially in
abstractions that check the proc's arity when deciding how to call the
block.

This is also a pre-requisite for doing something like #7741, which is a
partial fix for #3914 / #4149, where we infer the types of
`Kernel#lambda` blocks by codegenerating overloaded signatures.
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.

None yet

1 participant