digitalmars.D.bugs - 'private' attribute ignored???
- Mike (19/19) Jun 25 2005 The following compiles without complaint, and I can't for the life of me...
- Unknown W. Brackets (3/30) Jun 25 2005 Private is ignored within the same file iirc (because it assumes you
- Vathix (3/24) Jun 25 2005 Not a bug. You can access private stuff within the same module. It's D's...
- Hasan Aljudy (5/32) Jul 02 2005 Like the others said, private is ignored inside the same file :/ not
The following compiles without complaint, and I can't for the life of me see
why. Maybe a noob error that belongs on the 'learn' NG, but it's surprising to
say the least.
This is with both 0.126 and 0.127
------------
class Test
{
private int a;
private { int b; }
private:
int c;
}
void main()
{
Test test = new Test;
test.a = 1;
test.b = 1;
test.c = 1;
}
Jun 25 2005
Private is ignored within the same file iirc (because it assumes you
know what you're doing if you mess with your own classes.)
-[Unknown]
The following compiles without complaint, and I can't for the life of me see
why. Maybe a noob error that belongs on the 'learn' NG, but it's surprising to
say the least.
This is with both 0.126 and 0.127
------------
class Test
{
private int a;
private { int b; }
private:
int c;
}
void main()
{
Test test = new Test;
test.a = 1;
test.b = 1;
test.c = 1;
}
Jun 25 2005
On Sat, 25 Jun 2005 13:44:06 -0400, Mike <Mike_member pathlink.com> wrote:
The following compiles without complaint, and I can't for the life of me
see
why. Maybe a noob error that belongs on the 'learn' NG, but it's
surprising to
say the least.
This is with both 0.126 and 0.127
------------
class Test
{
private int a;
private { int b; }
private:
int c;
}
void main()
{
Test test = new Test;
test.a = 1;
test.b = 1;
test.c = 1;
}
Not a bug. You can access private stuff within the same module. It's D's
solution to friendship.
Jun 25 2005
Mike wrote:
The following compiles without complaint, and I can't for the life of me see
why. Maybe a noob error that belongs on the 'learn' NG, but it's surprising to
say the least.
This is with both 0.126 and 0.127
------------
class Test
{
private int a;
private { int b; }
private:
int c;
}
void main()
{
Test test = new Test;
test.a = 1;
test.b = 1;
test.c = 1;
}
Like the others said, private is ignored inside the same file :/ not
truely OOP, I made a post to complain about it, but it seems not many
people agree with me.
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/23420
Jul 02 2005









"Unknown W. Brackets" <unknown simplemachines.org> 