[Issue 2887] Wrong line number reported inside string mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 7 13:25:55 PDT 2009


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



--- Comment #2 from Nick Sabalausky <cbkbbejeap at mailinator.com> 2009-09-07 13:25:54 PDT ---
Workaround:

template foo()
{
  const char[] foo =
`{ auto __foo_line = __LINE__; // must be on first line
// Also, the extra surrounding {} is needed to
// allow foo to be used twice in the same scope.

Stdout.formatln("Foo:");
Stdout.formatln("  File {}", __FILE__);
Stdout.formatln("  Line {}", __foo_line);
}`;
}

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