www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - compiler crash

D:\code\d>type test.d
import std.stdio;

template Print( T )
{
T Print( T val ) { writefln( "%s", val ); return val; }
}

template Call( alias Fn, RT, alias V1 )
{
RT Call = Fn!( int )( V1 );
}

int x = 5;
void main()
{
Print!( int );
Call!( Print, int, x );
}
D:\code\d>dmd test
test.d(10): non-constant expression Print(x)
*kaboom*
Aug 05 2004