digitalmars.D.bugs - [Issue 20167] New: Issue warning when result discarded from strong
- d-bugmail puremagic.com (21/21) Aug 25 2019 https://issues.dlang.org/show_bug.cgi?id=20167
https://issues.dlang.org/show_bug.cgi?id=20167 Issue ID: 20167 Summary: Issue warning when result discarded from strong pure function? Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: turkeyman gmail.com It would be nice to have a compile error (or warning maybe) when the user discards the result from a stong pure function. If the function receives args `const`, and has no side effects, then calling the function is completely redundant if the result is discarded. At best it's pointless and inefficient, but in practise it's almost certainly a bug that the user didn't notice. --
Aug 25 2019