On 09/16/2012 05:08 PM, timotheecour wrote:
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));
}
----
This bug must be related:
http://d.puremagic.com/issues/show_bug.cgi?id=8579
Other bugs that are linked from that one mention an internal hash table.
Apparently different objects resolve to the same key, and the value of
the first key gets used from that hash table.
I don't know whether Kenji Hara's fix for the bug above also fixed this
issue. I say, open a bug anyway.
Ali