https://issues.dlang.org/show_bug.cgi?id=17853
Issue ID: 17853
Summary: Switch statement without braces only works with one
case
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
i.e:
---
int main()
{
int ob = 0;
final switch (ob++)
case 0: case 1:
break;
return ob;
}
---
Gives the error: 'function D main no return exp; or assert(0); at end of
function'
Remove one of the cases, and it compiles.
--