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

          Issue ID: 22388
           Summary: Wrong overload selected for @safe delegate
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

The following code fails to compile because the compiler selects the compiler
wrongly selects the first overload instead of the second one:


void setTimer(void delegate() callback) @system;

void setTimer(void delegate() @safe callback) @safe;

void main() @safe
{
    alias lambda = { assert(false); };
    setTimer(lambda);
}

--

Reply via email to