-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.
Description
Future<bool> doSomething() async => true;
void f1() {
if (await doSomething()) {}
}
void f2() {
await doSomething();
}
In f1()
, the error message is Unexpected text 'await'
, which denotes that AWAIT_IN_WRONG_CONTEXT
is not reported.
In f2()
the error message is correct, and there is a fix to add async
.
Once this is fixed, the proposed fix for #49114 chould also be enhanced to add async
if the method is not already async.
Possibly related failing test:
@failingTest | |
test_sync() async { |
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.