[Issue 15799] New: Misleading error message against the contract followed by semicolon in interface
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Mar 14 17:34:31 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15799
Issue ID: 15799
Summary: Misleading error message against the contract followed
by semicolon in interface
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: jiki at red.email.ne.jp
I've hit this three times, and each time I wondered "The grammer gets changed?
"
Too misleading message.
interface I {
void funA();
void funB(int n)
in {
assert(n);
}; // --- unexpected semicolon
}
Error: missing body { ... } after in or out
It's sure that the last semicolon is unexpected.
And I know this error is proper for _class_.
However, when turning funA into funB, we likely forget to remove the semicolon.
As a result, it is possible for people to mistake "Interface with contract is
illegal".
--
More information about the Digitalmars-d-bugs
mailing list