Closed
Description
The language specification allows void
-typed expressions to occur only in an enumerated number of syntactical positions. Those do not include await voidExpression
.
If you do:
void foo() {}
void main() {
await foo();
}
it should be a compile-time error, but it is accepted by both the front-end and the analyzer (the latter with a hint about awaiting a non-future).
The spec says:
The occurrence of an expression of type \VOID{} is a compile-time error unless it is permitted according to one of the following rules.
and then goes on to list the rules which do not include await
. So, the code above should be a compile-time error.