-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
closed-as-intendedClosed as the reported issue is expected behaviorClosed as the reported issue is expected behaviorlegacy-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
According to the Dart specification https://github.com/dart-lang/language/blob/48d3cbdb3dd4d75459453c69ef255064a4b89f13/specification/dartLangSpec.tex#L22709
The occurrence of an expression of type void is a compile-time error unless it is
permitted according to one of the following rules.
...
- In an expression of the form
await e,emay have typevoid.
But the code below produce compile-time errors in the both analyzer and CFE.
void foo() {}
main() async {
void e = 0;
await e; // Error: This expression has type 'void' and can't be used.
await foo(); // Error: This expression has type 'void' and can't be used.
}Dart SDK version: 3.7.0-99.0.dev (dev) (Mon Nov 4 08:02:58 2024 -0800) on "windows_x64"
Metadata
Metadata
Assignees
Labels
closed-as-intendedClosed as the reported issue is expected behaviorClosed as the reported issue is expected behaviorlegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.