auto _fun = fun(); //_fun == "main.d"
auto _tfun = tfun(); //_tfun == "main.d"
auto _tclass = new tclass!(); //_tclass.from == "other.d" !!!

//this works but i do not want to provide __FILE__ explicitly:
auto _tclassx = new tclass!(__FILE__)(); //_tclass.from == "main.d"
//and why do i get 2 different results for the last 2 cases?
}

This is a bug.

dlang.org agrees: http://dlang.org/template.html#TemplateValueParameter

right, i missed this in the specs. there seem to be several bug reports on this 
and related issues, eg:

http://d.puremagic.com/issues/show_bug.cgi?id=4018
http://d.puremagic.com/issues/show_bug.cgi?id=5686

apparently and old issue that was never addressed...too bad

Reply via email to