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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Aug 19 11:41:53 PDT 2016


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 at puremagic.com
          Reporter: kinke at 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)
```

--


More information about the Digitalmars-d-bugs mailing list