Bug 20736 – Wrong diagnostic for mismatch in delegate return type

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-04-14T07:16:37Z
Last change time
2024-12-13T19:08:06Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Moved to GitHub: dmd#19691 →

Comments

Comment #0 by andrej.mitrovich — 2020-04-14T07:16:37Z
----- struct Amount { int value; } immutable Amount MinFreezeAmount = Amount(1); void test (Amount delegate(Amount)) { } void main () { test(amount => MinFreezeAmount); } ----- > test.d(14): Error: function test.test(Amount delegate(Amount) _param_0) is not callable using argument types (void) > test.d(14): cannot pass argument __lambda1 of type void to parameter Amount delegate(Amount) _param_0 The diagnostic should be something like: > test.d(14): Error: function test.test(Amount delegate(Amount) _param_0) is not callable using argument types (immutable(Amount) delegate(Amount))
Comment #1 by robert.schadek — 2024-12-13T19:08:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19691 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB