digitalmars.D.bugs - scope problems with private
- Sean Kelly (40/40) Jul 29 2004 D:\code\d>type test.d
D:\code\d>type test.d D:\code\d>type test.d template Templ(T) { class TemplA { private: int val; } class TemplB { public: this() { TemplA a = new TemplA(); a.val = 5; } } } class Class(T) { class ClassA { private: int val; } this() { ClassA a = new ClassA(); a.val = 5; // failure is here } } int main() { Templ!(int).TemplB tb = new Templ!(int).TemplB(); Class!(int) cb = new Class!(int)(); return 0; } D:\code\d>dmd test.d test.d(31): class ClassA member val is not accessible
Jul 29 2004