-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
I have a problem with the following code:
void recreateDir(String path) {
deleteDir(path);
createDir(path);
}
Future<void> deleteDir(String path) async {};
Future<void> createDir(String path) async {};
Dart will happily let me call async functions from a non-async function without awaiting them.
In the above example it is problematic to call createDir before deleteDir which may occur if they are unawaited.
If the method createDir is async and I use the lint 'unawaited_futures' I get an appropriate warning.
However if I forget to add the async keyword to the createDir signature then I have a serious problem and no warning.
We need a lint to warn of the above issue.
The above example is a mistake that I make regularly in my own code and its rather hard to debug.
DetachHead, KotlinIsland and DanTup
Metadata
Metadata
Assignees
Labels
devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug