[Issue 23503] Add `lazy with`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 24 09:40:47 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23503

--- Comment #1 from Bolpat <qs.il.paperinik at gmail.com> ---
Regular (greedy) `with` is unusable in generic code when the `with`ed type or
expression is unknown. Greedy `with` can shadow any local identifier, which –
I’d boldly claim – is *never* intended.

`lazy with` on the other hand will never make an identifier visible in your
scope mean something else. Use-cases in generic code are still rare, but when
the `with`ed type or expression is required/expected to provide *some* specific
members, it can be used.

--


More information about the Digitalmars-d-bugs mailing list