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

--- Comment #6 from [email protected] ---
Here's a minimal compilable (requires dmd argument -wi, rather than -w)
example, for anyone trying to fix this:

module main;

import std.stdio;

void reachIf(bool x)()
{
    if(!x)
        return;
    writeln("reached"); // Warning: statement is not reachable
}

void main(string[] args) {
    reachIf!true();  // prints "reached"
    reachIf!false(); // triggers warning
}

--

Reply via email to