You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
static if (T.sizeof == 4) { /*A*/ }
else static if (T.sizeof == 8) { /*B*/ }
else static if (T.sizeof == 12) { /*C*/ }
version (Windows) {}
else version (linux) {}
else version (OSX) {}
static if (something) {}
else version (foo) {}
else static if (somethingelse) {}
----
When such a construct is detected and none of the conditional blocks is matched the compiler should warn/error about an unhandled case.
We could also try to make the declaration of such a ladder without an else-clause a warning/error. This would require an explicit "else {}" to achieve the current behavior and avoids inadvertently missing else clauses similar to how non-final switch statements require a default label.
The text was updated successfully, but these errors were encountered:
Martin Nowak (@MartinNowak) reported this on 2013-10-29T19:57:05Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=11381
CC List
Description
static if (T.sizeof == 4) { /*A*/ } else static if (T.sizeof == 8) { /*B*/ } else static if (T.sizeof == 12) { /*C*/ } version (Windows) {} else version (linux) {} else version (OSX) {} static if (something) {} else version (foo) {} else static if (somethingelse) {} ---- When such a construct is detected and none of the conditional blocks is matched the compiler should warn/error about an unhandled case. We could also try to make the declaration of such a ladder without an else-clause a warning/error. This would require an explicit "else {}" to achieve the current behavior and avoids inadvertently missing else clauses similar to how non-final switch statements require a default label.The text was updated successfully, but these errors were encountered: