Summary: Nothrow can't throw Errors
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-09-17 02:38:12 PDT ---
A nothrow function will refuse an explicit call to "throw Error":

nothrow void foo()
    assert(1, "Some error");
    assert(0, "Some error");
//This is fine

nothrow void bar()
    throw new Error("Some error");
//This is NOT fine
Error: object.Error is thrown but not caught
Error: function 'bar' is nothrow yet may throw

nothrow void baz()
        throw new Error("Some error");
//This works though (!)
//Obviously, the "Error" is not caught...

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to