www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16404] New: Funky type for parameterless lambdas () => { ... }

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

          Issue ID: 16404
           Summary: Funky type for parameterless lambdas () => { ... }
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kinke gmx.net

```
void bar(void function() f) {}
void bar(void delegate() d) {}

void foo()
{
    int i;
    bar(() => {});
    bar(() => { ++i; });
}
```

Output with DMD nightly:

```
M.d(7): Error: none of the overloads of 'bar' are callable using argument types
(void function() pure nothrow  nogc  safe function() pure nothrow  nogc  safe),
candidates are:
M.d(1):        M.bar(void function() f)
M.d(2):        M.bar(void delegate() d)
M.d(8): Error: none of the overloads of 'bar' are callable using argument types
(void delegate() pure nothrow  nogc  safe delegate() pure nothrow  nogc  safe),
candidates are:
M.d(1):        M.bar(void function() f)
M.d(2):        M.bar(void delegate() d)
```

--
Aug 19 2016