digitalmars.D.bugs - [Issue 1465] New: Value of x.stringof changes when used as a template parameter
- d-bugmail puremagic.com (27/27) Sep 01 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1465
- d-bugmail puremagic.com (9/9) Sep 01 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1465
http://d.puremagic.com/issues/show_bug.cgi?id=1465
Summary: Value of x.stringof changes when used as a template
parameter
Product: D
Version: 2.003
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: reiner.pope gmail.com
The following code, when compiling, prints "x" then "int". It should print "x"
both times.
template Print(string B)
{
pragma(msg, B);
}
int x;
pragma(msg, x.stringof);
alias Print!(x.stringof) s;
Assigning x.stringof to a compile-time constant string fixes it, eg
const text = x.stringof;
pragma(msg, text); // prints x
alias Print!(x.stringof) p; // prints x
--
Sep 01 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1465
deewiant gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
*** This bug has been marked as a duplicate of 1168 ***
--
Sep 01 2007








d-bugmail puremagic.com