[Issue 2057] New: Unexpected type names with template typedefs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 29 09:33:10 PDT 2008


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 at digitalmars.com
        ReportedBy: simen.kjaras at 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.


-- 



More information about the Digitalmars-d-bugs mailing list