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

          Issue ID: 19583
           Summary: Should report function modifiers in from as errors or
                    at least warnings
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

Functions modifiers in front of the function should be reported as warnings or
even errors.

class X {
    const int* f() { return null; } // should give a compiler warning
    int* g() const { return null; }
}

In the above code it is too easy to confuse it with const(int*). This is VERY
unreliable and should be warned loudly when somebody does this.

--

Reply via email to