See sample code:
int foo(char c) {
while (true) {
switch (c) {
case 'a':
goto default;
default:
return 3;
}
}
}
dmd gives an error:
Error: function `foo` no `return exp;` or `assert(0);` at end of function
As far as i can tell from experiments, dmd assumes that the "goto default" statement may jump out of the loop. Or something like that.
Comment #1 by robert.schadek — 2024-12-13T19:20:27Z