On Monday, 5 March 2018 at 16:18:11 UTC, Chris M. wrote:
Good stuff. Still bothers me that we had to special case "throw new Exception();" in order to make it nogc. I can't think of any better ways right now

Implementing EH for values (instead of class references) would have been a lot more complex.

but I wish it was more explicit.

Initially people always want more explicitness for new, not yet too well known, features, while later opting for terser syntax for commonly used things. Exceptions are supposed to be rare and deleting them directly after being catched seemed like a reasonable enough default to go with the specialization.
After all it solves a huge problem, error handling in @nogc code.
Maybe we'll find a better/cleaner solution when more of the language has been transitioned to @safe @nogc.

Reply via email to