-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes lint discarded_futures
does not recognize unawaited
.
#58911
Comments
unwaited
.discarded_futures
does not recognize unwaited
.
The lint, as described by itself, does not make exceptions for Maybe (It's not a lint I'd ever consider enabling myself, because there are plenty of reasons to make non- |
discarded_futures
does not recognize unwaited
.discarded_futures
does not recognize unawaited
.
Disregarding high-level considerations, I think there can't be any argument made that this lint is better by still complaining even after one adds |
If the lint is intended to disregard future-returning invocations inside an I'm saying that the description of the lint does not suggest that to be the case. Looking at the implementation CL, and the tests, they do suggest that (So yes, false positive, and description needs to be improved.) It's also still an overly broad lint, IMO. Passing a future as an argument to a function which expects a future as argument, should probably be considered as "not discarded", not matter which function it is. (Like #58889). Or calling a method on the future, like I'd prefer if it only warned in the same places where (@pq : The implementation seems a little eager to bail out. It stops recursing subexpression when it sees an invocation of |
Regarding the implementation, I'm guessing the check for |
Actually never mind, I'm not sure what actually happens with the interaction with |
Yup, the There is nothing magical about the That's another reason this lint worries me, it has to recognize |
|
Such an annotation would be introduced by the analyzer and likely be in If we want to get the functionality for platform declarations, we can use a |
Considering #59204, I've tested import 'dart:async';
Future<void> f() async {}
void g() {
unawaited(f());
} And got no lint so I think this can be closed? |
Thanks! |
Dor example, the file
devtools_app/lib/src/screens/performance/performance_controller.dart
in the PR: flutter/devtools#4659
The text was updated successfully, but these errors were encountered: