January 14, 2019 [Issue 19583] New: Should report function modifiers in from as errors or at least warnings | ||||
---|---|---|---|---|
| ||||
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. -- |
Copyright © 1999-2021 by the D Language Foundation