Discussion Thread: DIP 1038-- at nodiscard--Final Review
Paul Backus
snarwin at gmail.com
Fri Feb 5 14:16:22 UTC 2021
On Friday, 5 February 2021 at 14:09:09 UTC, claptrap wrote:
> Tbh i didnt even know D had warnings, nor that it warned about
> unused returns.
You would have learned if you'd read the DIP all the way through.
;)
https://github.com/dlang/DIPs/blob/ab056150975a9a8db5b5da3dbffdd81529802a49/DIPs/DIP1038.md#in-d
> Cant see the point with stuff like sqrt() though.
It's a generic warning that applies to any discarded expression
without side effects. For example, it will also trigger if you
write
1 + 1;
More information about the Digitalmars-d
mailing list