-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixesIssues with analysis server (quick) fixestype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
function inline with simple async code
Future<void> foo(int i, int j) async{
await Future.delayed(const Duration(seconds: 1));
print(i);
print(j);
}
Future<void> main() async {
int i = 1;
int j = 1;
await foo(i, j);
}
inline foo result:
Future<void> main() async {
int i = 1;
int j = 1;
await (int i, int j) async{
await Future.delayed(const Duration(seconds: 1));
print(i);
print(j);
}(i, j);
}
expected code:
Future<void> main() async {
int i = 1;
int j = 1;
await Future.delayed(const Duration(seconds: 1));
print(i);
print(j);
}
this pattern is valid but unnecessary it creates a lambda rather than inlining
await (int i, int j) async{ ................ }(i, j);
FMorschel
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixesIssues with analysis server (quick) fixestype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug