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

Track proc bindings of existing signatures #1064

Merged
merged 3 commits into from
Jul 15, 2022
Merged

Conversation

vinistock
Copy link
Member

Motivation

When we generate gem RBIs, we're not carrying over proc bindings from existing signatures. The reason is because sorbet-runtime doesn't actually keep track of the bind and just discards it.

This ends up creating some frustration when generating gem RBIs as proc bindings are ignored.

Implementation

Add a new Sorbet patch to keep track of the bind and print the T::Types::Proc name including it.

Tests

Added an example in the pipeline spec.

@vinistock vinistock requested a review from a team as a code owner July 15, 2022 14:00
@vinistock vinistock self-assigned this Jul 15, 2022
lib/tapioca/sorbet_ext/proc_bind_patch.rb Outdated Show resolved Hide resolved
lib/tapioca/sorbet_ext/proc_bind_patch.rb Outdated Show resolved Hide resolved
lib/tapioca/sorbet_ext/proc_bind_patch.rb Outdated Show resolved Hide resolved
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.

Perfect, thank you!

@vinistock vinistock merged commit 228ae7f into main Jul 15, 2022
@vinistock vinistock deleted the vs/track_proc_bindings branch July 15, 2022 18:51
@shopify-shipit shopify-shipit bot temporarily deployed to production July 19, 2022 17:59 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to 0-9-stable August 22, 2022 21:36 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants