Bug 23335 – Error: Template lambda has no value when assigning to ref delegate return

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-09-14T22:06:10Z
Last change time
2024-12-13T19:24:26Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
elpenguino+D
Moved to GitHub: dmd#20147 →

Comments

Comment #0 by elpenguino+D — 2022-09-14T22:06:10Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20147 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB