Skip to content

Report a compile-time error when an expression of type void is used #54889

Open
@eernstg

Description

@eernstg

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).implementationTrack the implementation of a specific feature (use on area-meta issue, not issues for each tool)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions