On Saturday, 3 July 2021 at 17:20:47 UTC, Luis wrote:
scope(exit) inside of a anonymous functions, it's never called.

I think the compiler infers the function `nothrow` since you don't throw any `Exception`, only an `Error`. Errors represent unrecoverable bugs, after which the program is in an invalid state, so the compiler is free to exit immediately without caring about destructors or `scope(exit)`. Use `Exception` instead of `Error` if you want the stack to properly unwind.

Reply via email to