-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[unawaited_futures] does not complain for async function that return void #59537
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
Comments
The support for having return type |
Your code doesn't know, and mustn't know, if a function it calls is So, as @eernstg says, if you don't want the future of |
I see, my function returned |
You could enable avoid_void_async in order to get a heads-up whenever there is a function whose body is This makes sense if you almost never want to write a "fire and forget" async function, and then you can mark the ones you might have anyway with |
I didn't notice this linter, thanks for mentioning it, I will use it moving forward 🙏 |
Duplicate of #57653 |
if my function is :
Future<void> _foo() async {
the linter will complain if I don't await _foo()
but if my function is:
void _foo() async {
no complain.
I know I'm not "unawait a future" here but what I want is to await all async functions even if they return
void
overFuture<void>
The text was updated successfully, but these errors were encountered: