cat > bug.d << CODE bool bug(int val) { switch (val) { mixin("case 0:"); auto v = 0; return true; default: return false; } } CODE dmd -c bug ---- bug.d(3): Error: 'switch' skips declaration of variable bug.bug.v at bug.d(6) ---- I'd guess something in the semantic order changed since 2.071.1.
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/fdf70df83495542b9829a2853d0b1c6ee58d83ea fix Issue 16254 - switch skips initialization error - replace intended diagnostic error with deprecation - checks should be improved to detect actual variable usage https://github.com/dlang/dmd/commit/a9b56bad42d6abf03fe5aa894c105733197dec0c Merge pull request #5922 from MartinNowak/fix16254 fix Issue 16254 - switch skips initialization error
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/fdf70df83495542b9829a2853d0b1c6ee58d83ea fix Issue 16254 - switch skips initialization error https://github.com/dlang/dmd/commit/a9b56bad42d6abf03fe5aa894c105733197dec0c Merge pull request #5922 from MartinNowak/fix16254