[Issue 12558] try/catch allows implicit catching of Errors without specifying any Exception type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Apr 25 07:15:52 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=12558

--- Comment #13 from Nick Treleaven <ntrel-pub at mybtinternet.com> ---
(Linked pull 5183 now has conflicts).

I discovered this with dmd 2.071.0:

@safe unittest
{
    try throw new Exception("");
    catch {} // Error: can only catch class objects derived from Exception in
@safe code, not 'object.Throwable'
}

But I think the error should occur in @system code too.

--


More information about the Digitalmars-d-bugs mailing list