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

          Issue ID: 15485
           Summary: switch with no case compiles
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

The below code compiles, but fails at run time with "No appropriate switch
clause found".
This could be made a compiler error.


void main()
{
    int x = 10;
    switch (x)
    {
        if (x == 10)
        {
            return;
        }
    }
}

--

Reply via email to