If class X and main are in the same module then this is not a bug, see:
http://www.digitalmars.com/d/attribute.html
"Private means that only members of the enclosing class can access the
member, or members and functions in the same module as the enclosing
class."
Note: "in the same module"
Regan

Sorry i miss that one... it's just that this rule doesn't seems to be so
natural
for a C++ programmer. It's really confusing and in fact, now that you bring it
to the table, it's ugly and useless.

I think it is there to deal with the C++ 'friend' concept. Class that are
friendly to each other are supposed to be coded into the same module
(a.k.a. source file).
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
9/11/2005 2:44:28 PM

From http://www.digitalmars.com/d/attribute.html:
"Static does not have the additional C meaning of being local to a file.
Use the private attribute in D to achieve that. For example:
module foo;
int x = 3; // x is global
private int y = 4; // y is local to module foo