unawaited_futures
should consider try {return future}
as unawaited
#59489
Labels
analyzer-linter
Issues with the analyzer's support for the linter package
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
linter-false-negative
P3
A lower priority bug or feature request
type-enhancement
A request for a change that isn't a bug
Describe the issue
When returning a
Future
inside async functions, when wrapped in atry
block, that future won't trigger anunawaited
lintTo Reproduce
Expected behavior
The
return future
line should emit anunawaited_futures
. And awaiting it or marking it as unawaited should make the issue disappear.Additional context
This is a common mistake. The
catch
/finally
blocks may not trigger correctly when the returned future is unawaited.The text was updated successfully, but these errors were encountered: