Comment #0 by destructionator — 2023-01-15T01:38:57Z
```
struct W {
string delegate() magic;
@safe
void content(lazy string s) {
magic = &s;
}
string test;
}
void main() {
W w;
w.content = w.test;
}
```
lzy.d(5): Error: cannot take address of lazy parameter `s` in `@safe` function `content`
The spec explicitly permits the taking of this address and since it is lowered to a delegate, the same rules should apply.
I suspect this was added as a hack because the implementation incorrectly fails to generate a closure for lazy params: https://issues.dlang.org/show_bug.cgi?id=23627
But the spec says nothing of the sort. If I wanted a `scope lazy`, I would have written `scope lazy`.
Comment #1 by robert.schadek — 2024-12-13T19:26:40Z