mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00

* Fix: Prevent ICE on final switch forward referencing its enum * more simpler approach * moved the enum member analysis * Move enum number analysis to sementic2 * WhiteSpace Remove * Remove Redundant Code in enumsem
20 lines
361 B
D
20 lines
361 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fix20867.d(14): Error: cannot use `final switch` on enum `E` while it is being defined
|
|
---
|
|
*/
|
|
|
|
// Test case from Issue #20867
|
|
enum E
|
|
{
|
|
a = 3,
|
|
b = () {
|
|
E e;
|
|
final switch (e) // This should error out instead of segfaulting
|
|
{
|
|
case E.a: break;
|
|
}
|
|
return 4;
|
|
} ()
|
|
}
|