[Issue 4018] Line Number not set at instatiation point

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 27 09:55:34 PDT 2010


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


Jesse Phillips <Jesse.K.Phillips+D at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Linux                       |All


--- Comment #2 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 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 = 0x00000005

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

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


More information about the Digitalmars-d-bugs mailing list