sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[cfe] Report a compile-time error when an expression of type `void` is used

Open eernstg opened this issue 1 year ago • 1 comments

This is the CFE specific issue for https://github.com/dart-lang/sdk/issues/54889, which has the details.

eernstg avatar Feb 12 '24 12:02 eernstg

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.

eernstg avatar Feb 14 '24 16:02 eernstg

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.

eernstg avatar Feb 27 '24 11:02 eernstg

OK, the language team accepted that this is not a breaking change. Removing the 'status-blocked' label.

eernstg avatar Feb 28 '24 18:02 eernstg