|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 2028] New: Can't create template class in module of same name
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 digitalmars.com ReportedBy: jlquinn 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? -- Apr 24 2008
<d-bugmail puremagic.com> wrote in message news:bug-2028-3 http.d.puremagic.com/issues/...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 digitalmars.com ReportedBy: jlquinn 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? Apr 24 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2028 ------- Comment #1 from webmaster villagersonline.com 2008-04-24 15:47 ------- I don't know whether to call this a bug or a language design issue, but I know the workaround: specify the full name Use a.a instead of a -- Apr 24 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2028 ------- Comment #2 from wbaxter gmail.com 2008-04-24 17:04 ------- (In reply to comment #1) Apr 24 2008
<d-bugmail puremagic.com> wrote in message news:fur052$309q$1 digitalmars.com...http://d.puremagic.com/issues/show_bug.cgi?id=2028 ------- Comment #2 from wbaxter gmail.com 2008-04-24 17:04 ------- (In reply to comment #1) Apr 24 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2028 ------- Comment #3 from wbaxter gmail.com 2008-04-24 18:23 ------- (In reply to comment #2)(In reply to comment #1) Apr 24 2008
|