alias to function literal, call without () not possible

Andre Pany via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 3 10:16:10 PDT 2016


Hi,

I just stumbled over this behavior. I am not sure whether
the behavior is correct or not.

alias foo = () => new Object;
void bar(Object o){}

void main()
{
	auto n1 = foo;
	bar(foo);
}

While first line in main is working fine,
second line does not compile due to missing ().

Is this correct?

Kind regards
André


More information about the Digitalmars-d-learn mailing list