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
Incorrect "T.cast is useless" error on T.bind with rescue / ensure blocks #6323
Comments
This usage of class D
include M
end I think what you're looking for here is # typed: strict
module M
extend T::Sig
extend T::Helpers
requires_ancestor { C }
end
class C
include M
end This also have the benefit of preventing |
Thanks! I'd agree that FWIW, I don't believe this bug is specific/related to M being a module. |
This is a perfectly valid use of bind, and this error should probably not reported. Not sure at a glance what the best solution is, but there are two options:
Anyways, thanks for the report. I'm not sure when I'll have time to get to this. |
(whoops wrong button 😅 sorry about the accidental close) |
Input
→ View on sorbet.run
Observed output
Runtime behavior: this version exercises the methods and runs with no errors.
Here's an additional sorbet.run example covering a few more cases.
Expected behavior
No errors.
The text was updated successfully, but these errors were encountered: