Summary: [tdpl] contracts should allow throw expressions
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrei Alexandrescu <> 2009-10-12 
13:25:03 PDT ---

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:
------- You are receiving this mail because: -------

Reply via email to