[Issue 20904] New: dip1000 implicit conversion delegates error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 7 17:02:50 UTC 2020


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

          Issue ID: 20904
           Summary: dip1000 implicit conversion delegates error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: john.loughran.colvin at gmail.com

% cat test.d
auto blah(void delegate())
{
}

void delegate()[string] r;
static this()
{
    void delegate() nothrow a;
    r["v"] = a;
}

% dmd -o- -dip25 -dip1000 test.d
test.d(9): Error: cannot implicitly convert expression a of type void
delegate() nothrow to void delegate()

This is a super strange error:
`A` isn't used but compilation succeeds if you remove it.
If you make `r` a normal array and do `r[0] = a;` compilation succeeds.

--


More information about the Digitalmars-d-bugs mailing list