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

           Summary: Wrong .stringof value for parameter type of a templated
                    function
           Product: D
           Version: 2.020
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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"


-- 

Reply via email to