[analyzer] AWAIT_IN_WRONG_CONTEXT
is not triggered in if
condition
#49116
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
front-end-fasta-recovery
P2
A bug or feature request we're likely to work on
In
f1()
, the error message isUnexpected text 'await'
, which denotes thatAWAIT_IN_WRONG_CONTEXT
is not reported.In
f2()
the error message is correct, and there is a fix toadd 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:
sdk/pkg/analyzer/test/src/diagnostics/await_in_wrong_context_test.dart
Lines 18 to 19 in c202252
The text was updated successfully, but these errors were encountered: