[Issue 12741] New: DMD accepts functions with contracts and no body
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 12 17:31:17 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12741
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 at puremagic.com
Reporter: briancschott at 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.
FunctionBody:
BlockStatement
BodyStatement
InStatement BodyStatement
OutStatement BodyStatement
InStatement OutStatement BodyStatement
OutStatement InStatement BodyStatement
--
More information about the Digitalmars-d-bugs
mailing list