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

           Summary: invariant does not compile/run if class does not
                    define constructor
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Andrej Mitrovic <[email protected]> 2012-11-13 
16:34:53 PST ---
class C
{
    invariant()
    {
        assert(0);
    }
}

void main()
{
    C c = new C();  // should fail after ctor invoked
}

C has an implicitly generated constructor, but the invariant isn't compiled or
it doesn't run. If you add an explicit empty constructor then it does get
added.

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

Reply via email to