This code produces an error - Error: Template lambda has no value. Last compiler able to compile it was DMD 2.078.3.
```
void main() {
fun = (a) {};
fun2 = (a) {};
}
void delegate(int) fun;
ref void delegate(int) fun2() {
return fun;
}
```
Comment #1 by razvan.nitu1305 — 2022-09-15T13:51:11Z
Note that `fun2() = (a) {}` works correctly (as a workaround).
Comment #2 by dlang-bot — 2022-09-16T11:15:48Z
@RazvanN7 created dlang/dmd pull request #14445 "Fix Issue 23335 - Error: Template lambda has no value when assigning …" fixing this issue:
- Fix Issue 23335 - Error: Template lambda has no value when assigning to ref delegate return
https://github.com/dlang/dmd/pull/14445
Comment #3 by dlang-bot — 2022-09-16T11:15:49Z
@RazvanN7 created dlang/dmd pull request #14445 "Fix Issue 23335 - Error: Template lambda has no value when assigning …" fixing this issue:
- Fix Issue 23335 - Error: Template lambda has no value when assigning to ref delegate return
https://github.com/dlang/dmd/pull/14445
Comment #4 by robert.schadek — 2024-12-13T19:24:26Z