Issue 23621 - Implicitly convert function to delegate
Summary: Implicitly convert function to delegate
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86 Windows
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-11 14:39 UTC by Marcelo Silva Nascimento Mancini
Modified: 2024-12-07 13:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Marcelo Silva Nascimento Mancini 2023-01-11 14:39:11 UTC
```d
import std.stdio;
int add(int delegate() a, int delegate() b){return a()+b();}
int getNumber(){return 50;}
void main()
{
    writeln(add(&getNumber, &getNumber));
}
```

This currently does not compile,  so it is needed tu wrap
Comment 1 dlangBugzillaToGithub 2024-12-07 13:42:23 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17456

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB