[Issue 22768] lazy does not cache its results
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 13 13:12:36 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22768
Stanislav Blinov <stanislav.blinov at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |stanislav.blinov at gmail.com
Resolution|--- |INVALID
--- Comment #1 from Stanislav Blinov <stanislav.blinov at gmail.com> ---
The spec does not mandate such behavior:
https://dlang.org/spec/function.html#lazy-params
The compiler *could* cache results if resulting delegate was strongly pure
(https://dlang.org/spec/function.html#pure-functions #17), but even that is
left up to the implementation, and `lazy` fails to infer attributes anyway.
--
More information about the Digitalmars-d-bugs
mailing list