-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
lazy_object: typed: strict #21263
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
lazy_object: typed: strict #21263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades lazy_object.rb from typed: true to typed: strict as part of the effort tracked in issue #17297 to improve type safety across the Homebrew codebase. The change adds Sorbet type signatures to all methods and initializes instance variables to satisfy strict mode requirements.
Key Changes:
- Upgraded Sorbet strictness level from
typed: truetotyped: strict - Added type signatures (
sig) to all methods:initialize,__getobj__,__setobj__,is_a?,class, andto_s - Initialized instance variables
@__callable__and@__getobj__withT.let(nil, T.untyped)in the constructor to satisfy strict mode requirements
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- use UNSET for better type safety
- to use a sentinel value for __getobj__ and improve initialization logic
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @hyuraku!
|
I'm now seeing intermittently seeing the following after this PR:
|
|
As mentioned internally, this is likely related to the use of |
|
Fixed by #21271. |
brew lgtm(style, typechecking and tests) with your changes locally?part of #17297