August 05, 2004 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* |
Copyright © 1999-2021 by the D Language Foundation