Bug 2465 – Wrong .stringof value for parameter type of a templated function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-11-21T05:17:00Z
Last change time
2015-06-09T01:20:25Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
samukha

Comments

Comment #0 by samukha — 2008-11-21T05:17:54Z
void foo(T)(T v) { pragma(msg, typeof(v).stringof); pragma(msg, T.stringof); static assert(is(typeof(v) == T)); //ok static assert(typeof(v).stringof == T.stringof); // fails for foo(1) } void main() { foo('a'); foo(1); } ---- The second foo instantiation fails because typeof(v).stringof evaluates to "char" instead of expected "int"
Comment #1 by clugdbug — 2009-04-20T04:46:37Z
Working in DMD 2.028 and 1.042. Probably fixed when 2527 was fixed?