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

Replace some include Kernel usages with requires_ancestor #18102

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Aug 20, 2024

This didn't exist way back but does now.

For Utils::Shebang::* I have made it more stricter than necessary (requires_ancestor { Formula } rather than Kernel) purely because they are documented as a "Mixin module for Formula", though they don't actually need or use anything from Formula. I can make it Kernel if preferred.

@dduugg
Copy link
Sponsor Member

dduugg commented Aug 20, 2024

Just flagging that, AFAIK, all current usage of requires_ancestor is in rbi files, bc I didn't want the runtime to depend on an experimental sorbet feature.

That may have been overly cautious though, since we ship with sorbet-runtime bundled. (If so, we can probably ditch a few rbi files with a migration PR.)

@Bo98
Copy link
Member Author

Bo98 commented Aug 20, 2024

Hmm that's a fair point. Though AFAIK requires_ancestor is no-op at runtime anyway.

I don't really have a strong opinion either way.

@dduugg
Copy link
Sponsor Member

dduugg commented Aug 20, 2024

Hmm that's a fair point. Though AFAIK requires_ancestor is no-op at runtime anyway.

I don't really have a strong opinion either way.

Yep (pending TODO): https:/sorbet/sorbet/blob/bb6e8f4/gems/sorbet-runtime/lib/types/helpers.rb#L63-L64

It's probably fine, just seems like a decision we should explicitly opt into.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Very nice, thanks @Bo98!

@MikeMcQuaid MikeMcQuaid merged commit d5b7de5 into master Aug 21, 2024
24 checks passed
@MikeMcQuaid MikeMcQuaid deleted the requires_ancestor branch August 21, 2024 08:06
@dduugg dduugg mentioned this pull request Oct 6, 2024
7 tasks
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.

4 participants