Open FMorschel opened 2 weeks ago
Relatedly, we did once have invariant_booleans but had to decommission it due to the high maintenance cost.
As for
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.
Given the above code what would the quick-fix produce?
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 https://github.com/dart-lang/sdk/issues/56715