[Issue 8674] New: template class name unconsistent behavior

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 16 19:42:24 PDT 2012


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

           Summary: template class name unconsistent behavior
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thelastmammoth at gmail.com


--- Comment #0 from thelastmammoth at gmail.com 2012-09-16 19:43:14 PDT ---
(from my previous post:
http://forum.dlang.org/thread/ikccpljusggbjekaqwmp@forum.dlang.org#post-bwfkyaurbgbmwcsepwtx:40forum.dlang.org)


Is that a bug?

The code below returns:

"main.A!(double).A"

if we uncomment "auto c=make!A(1.0);", we get:

"main.a!(double).A"

----
module main;
import std.stdio;
class A(T){
    T x;
    this(T x){this.x=x;}
}
auto make(alias a,T...)(T args){
    return new a!T(args);
}
void main(){
    //auto c=make!A(1.0);
    auto b=new A!double(1.0);
    writeln(typeid(b));
}
----

If this behavior is not a bug, I wonder what's the rationale, but also, how can
we have such a "make" function that doesn't mess up the template class name
depending on the order of which is used first (the make!T variant or the new
A!T) ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list