Report a compile-time error when an expression of type void
is used
#54889
Labels
area-meta
Cross-cutting, high-level issues (for tracking many other implementation issues, ...).
implementation
Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
An expression of type
void
cannot be used, unless it occurs in a situation which is specifically allow-listed.The language test
$SDK/tests/language/void/void_type_usage_test.dart
is testing that these compile-time errors occur. This test used to have some faults (in particular, it was a multi test that used some labels more than once, which allowed some missing compile-time errors to go undetected).The test is migrated to use the new test expectation syntax in https://dart-review.googlesource.com/c/sdk/+/350921 (that is
// ^^^
to define the location and then// [cfe] ...
and/or// [analyzer] ...
to specify the expected error message).With this test update, about 130 missing compile-time error failures exist with the analyzer and similarly for the common front end. This issue exists to indicate that those error messages should be emitted.
This issue awaits a breaking change process.
[Edit: This is not a breaking change, there were only a couple of test failures. Removing the 'status-blocked' label.]
Subtasks:
void
is used #54891The text was updated successfully, but these errors were encountered: