On Monday, 10 May 2021 at 01:25:10 UTC, Alain De Vos wrote:
This does not:
```
import std.stdio;
void main()
{
                int afunction(int x){return x;};

                it's not static so -> context -> delegate

                alias myint = int;
                myint i=5;
                alias tfunction = int function(int);
                tfunction f = & afunction;
                writeln(f(1));
}
```
It gives compile error :
Error: cannot implicitly convert expression &afunction of type int delegate(int x) pure nothrow @nogc @safe to int function(int)

add static in the second case.


Reply via email to