This builds: enum Test : ubyte { foo, bar, baz, } void main() { auto i = Test.bar; final switch (i) { case Test.foo: break; } } Remove the : ubyte and it doesn't.
Andrej Mitrovic notes that if : int is specified as the backing type, the sample fails to build as expected. So, it seems as if any non-default backing type causes the bug.
See also issue 5713
*** This issue has been marked as a duplicate of issue 4517 ***