Bug 3048 – out and invariant contracts is not working for const(C) classes

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2009-06-03T14:30:00Z
Last change time
2015-06-09T01:27:45Z
Assigned to
bugzilla
Creator
witold.baryluk+d

Comments

Comment #0 by witold.baryluk+d — 2009-06-03T14:30:15Z
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.
Comment #1 by dfj1esp02 — 2009-06-04T01:06:59Z
*** This issue has been marked as a duplicate of issue 2933 ***