[Issue 16201] 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 14:11:33 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16201

--- Comment #7 from Steven Schveighoffer <schveiguy at yahoo.com> ---
One thing that comes to mind on this -- successful compilation will DEPEND on
the ability to determine whether a branch escapes or not.

The goto is one thing.

What about a function that always throws and is inlined? (brought up by ketmar
in the forum discussion). A clever enough compiler can compile stuff that other
compilers do not. In essence the language needs to be very clear to what level
the implementation must go in order to prove it shouldn't look at the other
pieces.

With the unreachable statement warning, it's just a warning. One can still
compile without making it an error (and the warning is optional of course). For
this, it's not possible to make it a warning -- the code that should be ignored
won't compile.

--


More information about the Digitalmars-d-bugs mailing list