(sorry for not finding a better summary) //------------------- class A { void foo () {} private static void foo (int i) {} } class B { void foo (int x) { A.foo (x); } } //------------------- $ gdmd -c test1.d test1.d:12: class test1.B member foo is not accessible //-------------------
test cases: http://dstress.kuehne.cn/run/s/static_37_A.d http://dstress.kuehne.cn/run/s/static_37_B.d http://dstress.kuehne.cn/run/s/static_37_C.d http://dstress.kuehne.cn/run/s/static_37_D.d http://dstress.kuehne.cn/run/s/static_37_E.d http://dstress.kuehne.cn/run/s/static_37_F.d http://dstress.kuehne.cn/run/s/static_37_G.d http://dstress.kuehne.cn/run/s/static_37_H.d http://dstress.kuehne.cn/run/s/static_37_I.d http://dstress.kuehne.cn/run/s/static_37_J.d http://dstress.kuehne.cn/run/s/static_37_K.d
This is actually a bit worse. If you swap the order of the private static and public virtual foo, it compiles! class A { private static void foo(int i) {} public void foo() {} } class B { void bar(int x) { A.foo (x); } }