Closed
Description
Describe the issue
When returning a Future
inside async functions, when wrapped in a try
block, that future won't trigger an unawaited
lint
To Reproduce
Future<void> fn() async {
try {
return Future.value();
} catch (e) {
...
}
}
Expected behavior
The return future
line should emit an unawaited_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.