-
Notifications
You must be signed in to change notification settings - Fork 506
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
Make bare Class
an error
#6983
Make bare Class
an error
#6983
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
f4deb7e
to
5910569
Compare
8af1421
to
9488501
Compare
b573bbe
to
5c9b638
Compare
If you need to silence this error temporarily for a migration or compatibility reasons, you can pass this command line flag: --suppress-error-code=5046 This will suppress *all* bare stdlib generic errors, so things like `Array` and `Hash` will also not be reported as an error. Thus using this flag should be considered only a temporary migration mechanism. Other temporary migration techniques: - Downgrade any files with these errors to `# typed: true`, and re-upgrade them to `# typed: strict` once all bare `Class` errors have been fixed in the file. - Downgrade Sorbet back to the version before this error started to be reported. That version treats `T::Class` as valid type syntax, but does not report an error for bare `Class` usage.
We have a policy of testing changes to Sorbet against Stripe's codebase before Stripe employees can see the build results here: → https://go/builds/bui_NuhREj4kpTW4r4 |
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.
Is the migration plan for the all the Stripe errors to autocorrect everything to T::Class[T.anything]
?
Yep. |
Sorbet introduced a change to raise an error when `Class` is used as a type without generic type parameters: sorbet/sorbet#6983 This commit converts two instances of the `Class` type to `T::Class[T.anything]`
Sorbet has made using Class without specifying a generic type argument an error (sorbet/sorbet#6983), so this commit fixes the existing instances of this pattern in Tapioca.
Sorbet has made `Class` a generic type, so using `Class` on its own in type signatures now raises an exception (sorbet/sorbet#6983).
Sorbet has made `Class` a generic type, so using `Class` on its own in type signatures now raises an exception (sorbet/sorbet#6983).
* Make bare `Class` an error If you need to silence this error temporarily for a migration or compatibility reasons, you can pass this command line flag: --suppress-error-code=5046 This will suppress *all* bare stdlib generic errors, so things like `Array` and `Hash` will also not be reported as an error. Thus using this flag should be considered only a temporary migration mechanism. Other temporary migration techniques: - Downgrade any files with these errors to `# typed: true`, and re-upgrade them to `# typed: strict` once all bare `Class` errors have been fixed in the file. - Downgrade Sorbet back to the version before this error started to be reported. That version treats `T::Class` as valid type syntax, but does not report an error for bare `Class` usage. * Fix the bare `Class` in our payload * Fix existing tests * Capture master behavior for new test * Show test's new behavior * Also fix ClassNew rewriter * Fix test * Update cli exp
Note to users
If you need to silence this error temporarily for a migration or
compatibility reasons, you can pass this command line flag:
This will suppress all bare stdlib generic errors, so things like
Array
andHash
will also not be reported as an error. Thus usingthis flag should be considered only a temporary migration mechanism.
Other temporary migration techniques:
Downgrade any files with these errors to
# typed: true
, andre-upgrade them to
# typed: strict
once all bareClass
errors havebeen fixed in the file.
Downgrade Sorbet back to the version before this error started to be
reported. That version treats
T::Class
as valid type syntax, butdoes not report an error for bare
Class
usage.Motivation
This closes a follow-up action item from #6781.
Test plan
See included automated tests.
Review by commit to see the changes to the tests.