D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8674 - template class name unconsistent behavior
Summary: template class name unconsistent behavior
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-16 19:43 UTC by thelastmammoth
Modified: 2024-12-13 18:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description thelastmammoth 2012-09-16 19:43:14 UTC
(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) ?
Comment 1 dlangBugzillaToGithub 2024-12-13 18:01:26 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18470

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB