www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22514] New: Invalid duplicate case error when the switched

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

          Issue ID: 22514
           Summary: Invalid duplicate case error when the switched value
                    has errors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

The following code causes invalid `duplicate case X` errors when compiled with
dmd > 2.094:


void main()
{
    switch (doesNotExist)
    {
        case 1: break;
        case 2: break;
        case 3: break;
    }
}

Apparently introduced / revealed by https://github.com/dlang/dmd/pull/11467.

--
Nov 16 2021