Bug 20491 – extern(C) is not inferred for lambda arguments

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2020-01-08T23:38:00Z
Last change time
2024-12-13T19:06:43Z
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#19655 →

Comments

Comment #0 by maxsamukha — 2020-01-08T23:38:00Z
extern(C++) alias F = void function(); void foo(F f) { } void bar(void function() f) { } void main() { F f = () {}; // ok bar(() {}); // ok without extern(C); foo(() {}); // fail } onlineapp.d(12): Error: function onlineapp.foo(extern (C++) void function() f) is not callable using argument types (void function() pure nothrow @nogc @safe) onlineapp.d(12): cannot pass argument __funcliteral3 of type void function() pure nothrow @nogc @safe to parameter extern (C++) void function() f Same for extern(C++).
Comment #1 by maxsamukha — 2020-01-08T23:39:55Z
(In reply to Max Samukha from comment #0) > Same for extern(C++). extern(C)
Comment #2 by qs.il.paperinik — 2024-05-29T10:19:42Z
Related, but certainly no duplicate: https://issues.dlang.org/show_bug.cgi?id=24007
Comment #3 by robert.schadek — 2024-12-13T19:06:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19655 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB