[Issue 14064] New: Error message about @ attributes incomplete.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 27 08:56:55 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14064

          Issue ID: 14064
           Summary: Error message about @ attributes incomplete.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: issues.dlang at jmdavisProg.com

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.

--


More information about the Digitalmars-d-bugs mailing list