The error message mentions "finally", instead of "scope(exit)": deneme.d(53539): Error: cannot put catch statement inside finally block The program to reproduce with dmd 2.056: void main() { scope(exit) try {} catch {} } Note that it is the same with scope(success).
Yeah, this is caused by an internal rewrite of scope => try/catch/finally block.
https://github.com/D-Programming-Language/dmd/pull/3564
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/bb9fd7e2ad2c0fbc5ddd132129819fdcd2cc6bf0 fix Issue 6889 - "finally" mentioned in a compilation error, instead of "scope(exit)" or "scope(success)" https://github.com/D-Programming-Language/dmd/commit/75950518c1a448c85aa7e9db2033b09f4c377380 Merge pull request #3564 from 9rnsr/fix_onscope Issue 6889 & 2456 - Fix diagnostic messages for OnScomeStatement