[Wildcard Variables] Update UNUSED_CATCH_CLAUSE
reporting
#55723
Labels
analyzer-warning
Issues with the analyzer's Warning codes
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
feature-wildcard-variables
Implementation of the wildcard variables feature
P2
A bug or feature request we're likely to work on
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: