Bug 4946 – Not good error message with wrongly positioned 'const'
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-26T10:38:24Z
Last change time
2017-12-18T22:56:37Z
Keywords
bootcamp, diagnostic
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2010-09-26T10:38:24Z
This seems wrong D2 code:
struct Foo {
void bar(int x)() if (x > 0) const {}
}
void main() {}
DMD 2.049 prints:
test.d(2): semicolon expected following function declaration
But a better error message is to tell that the position of 'const' is wrong.
Comment #1 by andrej.mitrovich — 2012-12-27T18:05:06Z
*** Issue 6915 has been marked as a duplicate of this issue. ***
Comment #2 by razvan.nitu1305 — 2017-11-02T16:23:50Z