[Issue 6549] New: Implement contracts without implementation.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 24 11:23:36 PDT 2011


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

           Summary: Implement contracts without implementation.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2011-08-24 11:23:34 PDT ---
currently, code like the following is rejected:

abstract class C{
    int foo(int x)
      in{assert(x<0);}
      out(result){assert(result>0);}
}

tt.d(10): Error: function tt.C.foo in and out contracts require function body.

Which does not make sense, because contracts logically belong to the method
declaration.

Such code should be accepted and the contracts should be subject to contract
inheritance. This will require a tiny grammar change.

-- 
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