[Issue 16201] New: When all paths inside a static if return/throw, the portion after static if should be as if "else" were used
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jun 24 08:24:24 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16201
Issue ID: 16201
Summary: When all paths inside a static if return/throw, the
portion after static if should be as if "else" were
used
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: andrei at erdani.com
Consider:
static if (condition)
{
... code 1 ...
return;
}
... code 2 ...
This should be treated by the compiler the same as:
static if (condition)
{
... code 1 ...
return;
}
else
{
... code 2 ...
}
Currently it gets quite annoying to have to nest multiple static ifs and elses.
--
More information about the Digitalmars-d-bugs
mailing list