digitalmars.D.bugs - template class inheritance - bug with private
- Sark7 (18/18) Jul 06 2004 class A
- J C Calvarese (29/51) Jul 25 2004 I agree it's a bug (and it's still there in DMD 0.96).
class A { this() {} } class B(): A { private: // if I remove this line, module compiles successfully int foo; } class C: B!() { this() { printf("C "); } } void main() { C c = new C(); } Compiler [dmd v0.94] outputs: class C member this is not accessible
Jul 06 2004
Sark7 wrote:class A { this() {} } class B(): A { private: // if I remove this line, module compiles successfully int foo; } class C: B!() { this() { printf("C "); } } void main() { C c = new C(); } Compiler [dmd v0.94] outputs: class C member this is not accessibleI agree it's a bug (and it's still there in DMD 0.96). The bug seems to be that the "private:" doesn't end with the next "}" like it should. For example, this does seem to work: class A { this() {} } class B(): A { private { int foo; } } class C: B!() { this() { printf("C "); } } void main() { C c = new C(); } This bug is similar to another bug report(which also hasn't been fixed yet): http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/793 -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jul 25 2004