You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the above code what would the quick-fix produce?
For the full code as above (including the else), we could remove both the dead_code and also the if (true) { and closing braces for it. If there is no dead_code I think we could remove only if (true) { and the closing braces.
I would make the dead_code fix do what it's doing today, and I would have a separate assist for removing the if. (I assume it would need to be an assist because I don't think we have a lint to flag such a case. If I'm wrong, then we could make it a fix for that lint.)
If you have the following code:
Today we have no lint besides
dead_code
with a quick-fix for removing it.I'd like to ask for one and a quick-fix to remove the
if (true)
or whatever cases we know will always be true.This could also be triggered on
if (x case int when true)
to only remove thewhen true
or similar.--
Inspired by dart-lang/sdk#56715
The text was updated successfully, but these errors were encountered: