[Issue 22277] removing strongly pure function calls is an incorrect optimization
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 15 15:53:08 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22277
João Lourenço <jlourenco5691 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jlourenco5691 at gmail.com
--- Comment #8 from João Lourenço <jlourenco5691 at gmail.com> ---
> I am not sure this premise is true. A function returning 'void' may do no work at all or do work without observable side effects. I need to think more about this, thank you.
If the function is strongly pure that statement is correct. To do some work,
then it needs to be impure, or in the case of D, weakly pure. An example is all
the pure void functions that mess around with values of `this`.
--
More information about the Digitalmars-d-bugs
mailing list