discarded_futures
lint discussion
#59887
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
After some discussion over at #59877, #59331 and #58747, I've seen many users expecting
discarded_futures
to work similarly tounawaited_futures
but inside synchronous code.That is, inside synchronous code, if the
Future
is assigned to something that explicitly asks for aFuture
, do nothing, if not, trigger.That would solve all of these duplicates that expect the lint not to warn when using it on
FutureBuilder
from Flutter for example:discarded_futures
lint #58889discarded_futures
: Unwaited return for when Future is expected #59331Making the behaviour match
unawaited_futures
would also probably fix: #59204.I've opened https://dart-review.googlesource.com/c/sdk/+/403901 and I've made some changes to address this assignability issue, but @lrhn commented on the CL:
I'm opening this issue to track this discussion and hopefully to make that change.
// CC @lrhn @pq
The text was updated successfully, but these errors were encountered: