[Wildcard Variables] Update UNUSED_CATCH_CLAUSE
reporting
#55723
Labels
area-devexp
For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
devexp-warning
Issues with the analyzer's Warning codes
feature-wildcard-variables
Implementation of the wildcard variables feature
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Like
UNUSED_LOCAL_VARIABLE
s (#55719),UNUSED_CATCH_CLAUSE
should not special case__
s.This adjustment is straight-forward in the presence of an
on
clause where__
s are special cased, however the case without anon
is interesting... Currently we do not report unused catch clauses if there is noon
clause regardless of underscores.For example:
is treated the same as
(And neither produce a diagnostic.)
Question: with wildcard variables, should we start reporting
UNUSED_CATCH_CLAUSE
on all bound variables (and so on thecatch(e)
case above)?(Note that this will be a bit disruptive -- luckily the quick fix is easy to implement.)
/cc @kallentu @bwilkerson @munificent
The text was updated successfully, but these errors were encountered: