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

T.unsafe(S).new when missing required parameters #7332

Open
qaisjp opened this issue Sep 19, 2023 · 0 comments
Open

T.unsafe(S).new when missing required parameters #7332

qaisjp opened this issue Sep 19, 2023 · 0 comments
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers
Milestone

Comments

@qaisjp
Copy link
Collaborator

qaisjp commented Sep 19, 2023

Problem

Sometimes a codemod reveals type errors such that a struct is missing required parameters for T::Structs. It would be nice if you could use --suggest-unsafe to mute those errors for a later cleanup.

Proposed solution

class S < T::Struct
  prop :foo, String
end

S.new  # Expected an autocorrect to T.unsafe(S).new, just got an error

View on sorbet.run

@qaisjp qaisjp added enhancement New feature or surprising current feature unconfirmed This issue has not yet been confirmed by the Sorbet team labels Sep 19, 2023
@jez jez added good first issue Good for newcomers and removed unconfirmed This issue has not yet been confirmed by the Sorbet team labels Sep 19, 2023
@jez jez added this to the Autocorrects milestone Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants