https://issues.dlang.org/show_bug.cgi?id=20394
Issue ID: 20394
Summary: "one path skips constructor" when exception is thrown
Product: D
Version: D2
Hardware: All
URL: http://dlang.org/
OS: All
Status: NEW
Severity: normal
Priority: P3
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
struct X
{
this(int a)
{
if(a == 0)
this(a, 1);
else
throw new Exception("");
}
this(int a, int b) {}
}
The code above fails to compile with "one path skips constructor" error. It can
be worked around by adding "assert(0);" to the else block, but shoudn't
throwing exception be enough?
--