Code:

void main()
{
    auto foo = (int x = 10){ /* */ };
    void delegate() bar = foo;
}

Since foo takes an argument that already has a default it can be used
as a simple `void delegate()`, so maybe it makes sense for `foo` to be
able to implicitly convert to such a type.

Unfortunately doing a cast doesn't work properly:

import std.stdio;

void main()
{
    auto foo = (int x = 10){ writeln(x); };
    void delegate() bar;
    bar = cast(typeof(bar))foo;

    bar();  // prints garbage
}

So maybe this type of conversion is impossible in the first place due
to how arguments are passed? I don't know all the technical tidbits,
but from a user's point of view an implicit conversion kind of makes
sense (if it's possible).

Reply via email to