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 bug.foo (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.
Comment #1 by robert.schadek — 2024-12-13T18:53:56Z