digitalmars.D.bugs - [Issue 19583] New: Should report function modifiers in from as
- d-bugmail puremagic.com (24/24) Jan 14 2019 https://issues.dlang.org/show_bug.cgi?id=19583
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 puremagic.com Reporter: porton 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. --
Jan 14 2019