[Issue 2028] New: Can't create template class in module of same name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 24 13:04:28 PDT 2008


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

           Summary: Can't create template class in module of same name
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jlquinn at us.ibm.com


I'm not sure this is a bug or a language limitation, but it feels like a bug...

I have 2 modules:

a.d:
class a(T) {}

b.d:
import a;
class b {
  a!(int) x;
}

When I try to compile this, I get the following error:

~/dmd/bin/dmd -c a.d b.d
b.d(4): template instance a is not a template declaration, it is a import
b.d(4): Error: a!(int) is used as a type
b.d(4): variable b.b.x voids have no value

Why can't I do this?


-- 



More information about the Digitalmars-d-bugs mailing list