Summary: scope(failure) is not allowed in contracts
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Koroskin Denis <> 2009-10-14 07:40:55 PDT 
import std.stdio;

int sqrt(int i)
out (result)
    scope (failure) writeln("ooops");

    assert(result * result == i); 
    return i / 2;    // buggy implementation :)

Error: Throw statements cannot be in contracts

I'm not sure if it's a good idea to disallow throw statements in contracts:
It's so easy to overcome this restriction (by calling assert or any other
function that will throw) that I don't think it's worth the trouble.

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

Reply via email to