[Issue 19583] New: Should report function modifiers in from as errors or at least warnings

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 14 17:54:13 UTC 2019


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: nobody at puremagic.com
          Reporter: porton at narod.ru

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.

--


More information about the Digitalmars-d-bugs mailing list