July 07, 2004 template class inheritance - bug with private | ||||
---|---|---|---|---|
| ||||
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 |
July 25, 2004 Re: template class inheritance - bug with private | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sark7 | 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 accessible I 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/ |
Copyright © 1999-2021 by the D Language Foundation