www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2057] New: Unexpected type names with template typedefs

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

           Summary: Unexpected type names with template typedefs
           Product: D
           Version: 2.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: simen.kjaras gmail.com


struct foo(T)
{
        T value;
}

template bar(T)
{
        typedef foo!(T) bar;
}

void main(string[] args)
{
        writefln((bar!(int)).stringof); // prints 'bar'
        writefln((bar!(float)).stringof); // also prints 'bar'
}

Seeing as these two are different instantiations of the bar template, it seems
weird to me that they have the same type name.

The typedef maps to bar!(something), hence should the name as well.


-- 
Apr 29 2008