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

--- Comment #3 from Basile-z <[email protected]> ---
The promotion of a switch condition should be done after checking the cases.
Then a second pass should be done on the CaseStatement expressions to
implicitly cast them to the, eventually promoted, condition. Which should never
be a problem.

This is specifically and **definitively** a front-end bug on the
SwitchStatement as for example

---
enum Good : ubyte { a = 1 }
enum Bad  : ubyte { a = 2 }

void main(string[] args)
{
    Good good;
    if (good == Bad.a){}
}        
---

is rejected. As the cases of a switch should be.

--

Reply via email to