-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesfeature-wildcard-variablesImplementation of the wildcard variables featureImplementation of the wildcard variables featuretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Like UNUSED_LOCAL_VARIABLEs (#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 an on is interesting... Currently we do not report unused catch clauses if there is no on clause regardless of underscores.
For example:
try {
} catch(e) { }is treated the same as
try {
} catch(_) { }(And neither produce a diagnostic.)
Question: with wildcard variables, should we start reporting UNUSED_CATCH_CLAUSE on all bound variables (and so on the catch(e) case above)?
(Note that this will be a bit disruptive -- luckily the quick fix is easy to implement.)
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesfeature-wildcard-variablesImplementation of the wildcard variables featureImplementation of the wildcard variables featuretype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug