[Issue 21420] Nullable.get default parameter is not lazy

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 24 09:42:13 UTC 2020


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

--- Comment #1 from FeepingCreature <default_357-line at yahoo.de> ---
Oh, I see. It's an issue with lazy... I've tried to fix this, and it runs into
the issue that lazy, being not templated, cannot transfer call site guarantees
such as @safe and nothrow into the getter function, hence breaking get()'s
annotations of nothrow and @safe in a way that makes it unusable in
nothrow/@safe code.

And there is not even hope that DIP1033 fixes this, because the knowledge that
the expression is @safe/nothrow cannot be transferred in through a function
call - because the conversion to delegate happens *after* the template
instantiation, and the delegate type is the first place that we could have
@safe/nothrow knowledge.

Damn...

--


More information about the Digitalmars-d-bugs mailing list