sdk
sdk copied to clipboard
[cfe] Report a compile-time error when an expression of type `void` is used
This is the CFE specific issue for https://github.com/dart-lang/sdk/issues/54889, which has the details.
This turns out to potentially need a breaking change process, so please do not proceed to work on the implementation at this time.
I've added a 'status-blocked' label to make this situation visible. I'll remove it again if and when the breaking change is approved. The description of the changes may be modified during this breaking change process. I hope this bad ordering of events did not disrupt your work.
Various adjustments of the test (including corrections of mistakes introduced by the migration from a //# ... multi test to a modern // ^^^ test) have eliminated all test failures with the CFE except 3, and they are all concerned with expressions of the form e += 1 where e has static type void.
The issue is still on the agenda of the language team, but I expect that it will be considered as a non-breaking bug fix to start reporting an error in those cases. I'll unblock the issue and follow up when we have some input from the language team.
OK, the language team accepted that this is not a breaking change. Removing the 'status-blocked' label.