[Issue 3048] New: out and invariant contracts is not working for const(C) classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 3 14:30:16 PDT 2009


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

           Summary: out and invariant contracts is not working for
                    const(C) classes
           Product: D
           Version: 2.028
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: baryluk at smp.if.uj.edu.pl


Hi,

This code doesn't compile:

class A { }

const(A) func()
out (res) {
    assert(true);
}
body {
    return new A;
}


And this one:

class A {

const(A) func()
out (res) {
    assert(true);
}
body {
    return new A;
}
}

And this one:


class A {
invariant {
assert(true);
}

const(A) func(){
    return new A;
}
}

// this is especially strange, considering the fact that contracts are supposed
to be designed as free of side effects.

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


More information about the Digitalmars-d-bugs mailing list