This code compiles: void fun() nothrow { scope(failure) {} throw new Exception("so sue me"); } Generally the presence of scope(failure) completely shuts down checking for nothrow. See discussion in http://forum.dlang.org/thread/l6ccae$2cmt$1@digitalmars.com?page=3#post-20131118183251.63faaba7:40marco-leise for a sketch of the desirable/correct behavior.
To wit, this should work under the new semantics: void fun() nothrow { scope(failure) { throw new Error("wowzers"); } throw new Exception("so sue me"); } This is because nothrow functions may still throw Error. This should work as well: void fun() nothrow { scope(failure) assert(0); throw new Exception("so sue me"); }
https://github.com/D-Programming-Language/dmd/pull/3592
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/aad35c3af1132b59b906171a155f0e21da24c59b fix Issue 11542 - scope(failure) messes up nothrow checking https://github.com/D-Programming-Language/dmd/commit/b72ed88d2394188ea2c08cfbe5b3d2fe8e88c3ef Merge pull request #3592 from 9rnsr/fix11542 Issue 11542 & 12809 - Improve blockExit calculation on try-catch-finally statement