Revert "Return a shared type instance from type constructors when runtime checking is disabled"#23091
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request reverts the prior optimization in standalone/sorbet.rb that returned a shared type instance from Sorbet type constructors when $HOMEBREW_SORBET_RUNTIME is unset, restoring the original runtime-disabled behavior for type construction.
Changes:
- Removes the no-op overrides for Sorbet type constructors (e.g.,
T.nilable,T.any, and typed collection indexers) in the runtime-disabled branch. - Stops prepending the removed constructor-override module into
T’s singleton class, so type constructors behave as they did before PR #23078.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The additional failure of https://github.com/Homebrew/brew/actions/runs/29296519551/job/86971139791 leads me to think that #23078 was a bit too creative with sorbet-runtime overrides (although the tapioca code should probably use the unpatched sorbet-runtime path, it still illustrates the dragons lurking with the approach). I will more thoughtfully revisit this approach another time. |
Summary
Reverts #23078 ("Return a shared type instance from type constructors when runtime checking is disabled").
Changes
Reverts the 33-line change to
Library/Homebrew/standalone/sorbet.rbin full, restoring the original type constructor behaviour when$HOMEBREW_SORBET_RUNTIMEis unset.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?