[Issue 4018] Line Number not set at instatiation point

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4018


Jesse Phillips  changed:

   What|Removed |Added

 OS/Version|Linux   |All


--- Comment #2 from Jesse Phillips  2010-03-27 
09:55:31 PDT ---
In that case, the below has the same result.


import std.stdio;

void ODSfd(alias n, string file = __FILE__, int line = __LINE__)() {
  writefln("%s:%s | %s = %d", file, line, n.stringof, n);
}
void ODSfs(alias n, string file = __FILE__, int line = __LINE__)() {
  writefln("%s:%s | %s = %s", file, line, n.stringof, n);
}
void ODSfx(alias n, string file = __FILE__, int line = __LINE__)() {
  writefln("%s:%s | %s = 0x%08x", file, line, n.stringof, n);
}

void main() {
   int zbar = 5;
   string foo = "hi";

   ODSfd!(zbar);
   ODSfs!(foo);
   ODSfx!(zbar);
}
-

Expected Output:
linefile.d:17 | zbar = 5
linefile.d:18 | foo = hi
linefile.d:19 | zbar = 0x0005

Actual Output:
linefile.d:3 | zbar = 5
linefile.d:6 | foo = hi
linefile.d:9 | zbar = 0x0005

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4018] Line Number not set at instatiation point

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4018


Justin Spahr-Summers  changed:

   What|Removed |Added

 CC||justin.spahrsumm...@gmail.c
   ||om


--- Comment #1 from Justin Spahr-Summers  
2010-03-27 11:44:50 CDT ---
(In reply to comment #0)


Note that the docs say that referring to template value parameters. The code
you posted is intended behavior; you would have to add a couple value
parameters to each one that default to __FILE__ and __LINE__ and print those
out.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---