why are types mismatch?

Roman shamyan.roman at gmail.com
Tue Oct 1 11:07:30 PDT 2013


alias int function(int) function_type;



void main()
{
	bar!foo(2);
	bar!((int i)=> i*2)(2);
}

int foo(int i)
{
     return i;
}

void bar(alias baz)(int i)
{
	static if (!is(typeof(baz) == function_type))
	{
		pragma(msg, typeof(baz), " != ", function_type); //wtf?
	}

	std.stdio.writeln(bar(i));
}

Where am I wrong?


More information about the Digitalmars-d mailing list