"Casey" wrote in message news:[email protected]...
Good evening,
I have a question for you. Why does collectException violate the noThrow
attribute? I would have thought that since it captures an Exception, it
would allow the method that normally would throw an exception to be used
within a noThrow method. I did get the same effect by nesting it within a
assumeNoThrow method, but I'm still curious as to why collectException
doesn't make the same guarantee.
Btw: this is with dmd 2.066.1.
import std.exception;
void main() nothrow
{
collectException({ throw new Exception(null); });
}
Works fine to me. Are you catching 'Exception' or catching a specific
Exception subtype? If the latter, there's your answer - other types of
exceptions will still leak through.