Bug 14064 – Error message about @ attributes incomplete.
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-27T16:56:55Z
Last change time
2021-07-11T23:43:25Z
Keywords
pull, trivial
Assigned to
wolframw
Creator
Jonathan M Davis
Comments
Comment #0 by issues.dlang — 2015-01-27T16:56:55Z
This code
@deprecated void func() {}
void main() {}
results in this error:
q.d(1): Error: @identifier or @(ArgumentList) expected, not @deprecated
q.d(1): Error: valid attributes are @property, @safe, @trusted, @system, @disable
Notice that the list of valid @ attributes is missing @nogc (presumably, because it's new). Also, if the change for issue# 13388 doesn't get reverted, then @nothrow, @pure, and @return will need to be added to the list.
Ideally, I would think that the error message would treat the problem a bit like happens with a spelling error for variables, and ask if you meant "deprecated" instead of "@deprecated" - at least as long as @deprecated hasn't been declared as a UDA anyway - but if we're going to give a list of built-in attributes with @, the list should be correct and complete.