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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 12 10:47:27 PDT 2011


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

           Summary: Error when template is instantiated in a class
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: robert at octarineparrot.com


--- Comment #0 from Robert Clipsham <robert at octarineparrot.com> 2011-05-12 18:43:25 BST ---
The following code:
----
template Templ(alias T)
{
    alias T!int Templ;
}

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

// Uncomment this to make the error go away
//Templ!C foo;

void main()
{
    C!int a;
}
----
Gives the error:
----
test.d(3): Error: template instance T is not a template declaration, it is a
class
----
When uncommenting the line mentioned in the code the error goes away,
presumably because the forward reference goes away.

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