caller trouble

captaindet 2krnk at gmx.net
Sat Jul 14 12:28:17 PDT 2012


>> 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


More information about the Digitalmars-d-learn mailing list