[Issue 5988] Error when template is instantiated in a class

2013-02-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5988


Andrej Mitrovic  changed:

   What|Removed |Added

   Keywords|rejects-valid   |accepts-invalid
 CC||andrej.mitrov...@gmail.com
 OS/Version|Mac OS X|All


--- Comment #3 from Andrej Mitrovic  2013-02-09 
06:06:21 PST ---
(In reply to comment #2)
> This is because that class template is actually
> 
> template C(T) {
>   class C {
> 
>   }
> }
> 
> so the C inside is referring to the class C, not the template C. This code
> works:
> 
> class C(T) {
>   Templ!(.C) foo;
> }
> 
> I don't know why uncomment the global instantiation makes the problem goes
> away.

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

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


[Issue 5988] Error when template is instantiated in a class

2011-05-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5988


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #2 from kenn...@gmail.com 2011-05-12 19:35:48 PDT ---
This is because that class template is actually

template C(T) {
  class C {

  }
}

so the C inside is referring to the class C, not the template C. This code
works:

class C(T) {
  Templ!(.C) foo;
}

I don't know why uncomment the global instantiation makes the problem goes
away.

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


[Issue 5988] Error when template is instantiated in a class

2011-05-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5988



--- Comment #1 from Robert Clipsham  2011-05-12 
20:19:19 BST ---
This issue can be worked around using:

alias C Workaround;
class C(T)
{
Templ!Workaround foo;
}

This shouldn't be needed though.

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