[Issue 22406] New: importC: Error: 'switch' statement without a 'default'; use 'final switch' or add 'default: assert(0);' or add 'default: break;'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 17 13:52:44 UTC 2021


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

          Issue ID: 22406
           Summary: importC: Error: 'switch' statement without a
                    'default'; use 'final switch' or add 'default:
                    assert(0);' or add 'default: break;'
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

I guess SwitchStatements are not handled at all by importC semantics.
---
void f1()
{
    switch (1)
    {
        case 1:
            break;
    }
}
---

Also, the compiler emits:
---
Error: `object` is not a member of `void`

--


More information about the Digitalmars-d-bugs mailing list