[Issue 5988] Template accepts instantiating an already-instantiated template type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 9 06:08:44 PST 2013


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



--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-02-09 06:08:43 PST ---
(In reply to comment #3)
> Yeah, this is an accepts-invalid for this test-case:
> 
> template Templ(alias T)
> {
>     alias T!int Templ;
> }
> 
> class C(T)
> {
>     Templ!(C) foo;  // should be NG, must use Templ!(.C)
> }
> 
> Templ!C foo;
> 
> void main()
> {
>     C!int a;
> }

I think the cause could perhaps be a mangling issue or the way the compiler
searches for template instances. It finds a 'Templ!C' and decides to use that
instead of instantiating a new 'Templ!C', where 'C' is something completely
different.

-- 
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