www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20904] New: dip1000 implicit conversion delegates error


          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 puremagic.com
          Reporter: john.loughran.colvin 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.

Jun 07 2020