http://d.puremagic.com/issues/show_bug.cgi?id=3388

           Summary: [tdpl] contracts should allow throw expressions
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: and...@metalanguage.com


--- Comment #0 from Andrei Alexandrescu <and...@metalanguage.com> 2009-10-12 
13:25:03 PDT ---
Consider:

void fun(int x)
in {
    if (x < 0) throw new Exception("a");
}
body {
}

This doesn't compile with: 

Error: Throw statements cannot be in contracts

This is a useless limitation because a contract could always call a function
that throws an arbitrary exception. So effectively the only effect is that it
makes it difficult for functions to throw custom exceptions when their
contracts are violated. The limitation should be lifted.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to