[Issue 23335] New: Error: Template lambda has no value when assigning to ref delegate return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 14 22:06:10 UTC 2022


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

          Issue ID: 23335
           Summary: Error: Template lambda has no value when assigning to
                    ref delegate return
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

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;
}
```

--


More information about the Digitalmars-d-bugs mailing list