Bug 17739 – Calling convention of not deduced for delegate function arguments with explicit parameter types

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-08-10T12:06:59Z
Last change time
2024-12-13T18:53:56Z
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#17811 →

Comments

Comment #0 by timon.gehr — 2017-08-10T12:06:59Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17811 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB