Issue ID: 17739
           Summary: Calling convention of not deduced for delegate
                    function arguments with explicit parameter types
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd

DMD v2.075.0:

alias F=extern(C) int delegate(int);
void foo(F dg){ }
void main(){
    F dg=(int a)=>a; // ok
    foo((int a)=>a); // error

the error message is:

bug.d(5): Error: function (extern (C) int delegate(int) dg) is not
callable using argument types (int function(int a) pure nothrow @nogc @safe)

The code compiles if the explicit parameter type is removed from the delegate.

The code should compile.


Reply via email to