www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22388] New: Wrong overload selected for safe delegate


          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: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

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); };

Oct 14 2021