Bug 15799 – Misleading error message against the contract followed by semicolon in interface

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-03-15T00:34:00Z
Last change time
2016-10-01T11:45:11Z
Keywords
diagnostic, pull, rejects-valid
Assigned to
nobody
Creator
jiki

Comments

Comment #0 by jiki — 2016-03-15T00:34:31Z
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".
Comment #1 by k.hara.pg — 2016-03-24T14:46:30Z
This is a bug since the beginning of the feature implementation. https://github.com/D-Programming-Language/dmd/commit/b0c80159d1080ddb13cc2c438f139bd153c9d79a
Comment #2 by k.hara.pg — 2016-03-24T14:56:25Z
Comment #3 by github-bugzilla — 2016-05-07T12:12:03Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/078067a0222440d4bd2b833f8e0d73bb06730b20 fix Issue 15799 - Misleading error message against the contract followed by semicolon in interface https://github.com/dlang/dmd/commit/0dfaaecac67e7cb94fbb41eda410751039b64e15 Merge pull request #5571 from 9rnsr/fix15799 Issue 15799 - Misleading error message against the contract followed by semicolon in interface
Comment #4 by github-bugzilla — 2016-10-01T11:45:11Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/078067a0222440d4bd2b833f8e0d73bb06730b20 fix Issue 15799 - Misleading error message against the contract followed by semicolon in interface https://github.com/dlang/dmd/commit/0dfaaecac67e7cb94fbb41eda410751039b64e15 Merge pull request #5571 from 9rnsr/fix15799