Hi,
I'm trying to do a version of this:

        import std.stdio;

        void main()
        {
                execute(writeln("Hello, world"));
                execute({return 5;});
        }

        void execute(int delegate() f)
        {
                writeln("f is delegate, returning ", f());
        }

        void execute(lazy void f)
        {
                writeln("f is lazy void");
                f();
        }

which causes the compiler to respond: Error: void does not have a default initializer.

I've narrowed it down to the fact that the function "execute" is overloaded - if I give them different names, it works fine.

My question is, is this a bug or is it an intentionally disabled way of overloading the functions?

Reply via email to