www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20522] New: Spurious statement unreachable warning caused by

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

          Issue ID: 20522
           Summary: Spurious statement unreachable warning caused by
                    undefined variable
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: yshuiv7 gmail.com

Test case:

void main(){
        import std.stdio : File;
        {
                auto test = File("a"); // <- Essential
                non_existent;
        }
        // Warning: statement is not reachable
        string[] is_this_unreachable_question_mark;
}

--
Jan 21