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

           Summary: Disallow inoperant "in" contracts
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: and...@metalanguage.com


--- Comment #0 from Andrei Alexandrescu <and...@metalanguage.com> 2011-07-02 
21:21:52 PDT ---
Consider:

class A { void fun(int) {} }

class B : A { void fun(int x) in { assert(x > 0); } body {} }

In this case B's in contract is never called. The compiler should disallow the
code. To make the code work, an empty "in" contract on A.fun should suffice.
The error message should mention that.

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

Reply via email to