www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12741] New: DMD accepts functions with contracts and no body


          Issue ID: 12741
           Summary: DMD accepts functions with contracts and no body
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: briancschott gmail.com

DMD accepts the following:

interface SomeInterface
    void doStuff(int x) in { assert (x < 100); }

The grammar specification states that a body statement is required when an in
or out contract is specified.

    InStatement BodyStatement
    OutStatement BodyStatement
    InStatement OutStatement BodyStatement
    OutStatement InStatement BodyStatement

May 12 2014