Bug 9129 – Definite return analysis fails for nested case statements
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-09T12:46:01Z
Last change time
2023-02-11T07:39:05Z
Assigned to
No Owner
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2012-12-09T12:46:01Z
DMD 2.060:
enum E{ v }
template Seq(T...){ alias T Seq; }
int foo(){
E e;
final switch(e){
if(e) case E.v: return 0;
}
final switch(e)
foreach(x;Seq!(E.v))
case x: return 0;
}
Error: function foo no return exp; or assert(0); at end of function
The code should compile.