I guess in D, just like (I think) C++ and Java, member variables cannot
be overridden. And so x and y defined in B are distinct members, which
hide the identically named members in A. And since they don't override,
foo only sees the x and y declared in A, while bar sees the ones
declared in B.
I'm not convinced that this should be allowed, unless the base class x
and y are private. But I guess it's debatable.
But I would certainly consider it a bug that the word 'abstract' is
allowed here.
To specify new initialisations for inherited members, use a constructor.
Static members (functions or variables) don't override either AIUI. If
you need this for some type identification or similar, use a non-static
property instead.
Stewart.
--
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment. Please keep
replies on the 'group where everyone may benefit.

I should've said this is going to be my last post before I disappear off
to Finland next week, if you hadn't picked up my post in digitalmars.D.
Still, maybe someone else here can help you....
Stewart.
--
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment. Please keep
replies on the 'group where everyone may benefit.

I guess in D, just like (I think) C++ and Java, member variables cannot
be overridden. And so x and y defined in B are distinct members, which
hide the identically named members in A. And since they don't override,
foo only sees the x and y declared in A, while bar sees the ones
declared in B.

Ahh yes... I see there is no vtable for member variables only member
functions.
I can solve it by making a function for getting the variable. This occured
to me just after posting this question.

I'm not convinced that this should be allowed, unless the base class x
and y are private. But I guess it's debatable.

In my actual problem they were private, but it seems to make no difference.

But I would certainly consider it a bug that the word 'abstract' is
allowed here.

Yeah.. if this isn't to be allowed something like the C++ error:
'virtual' not permitted on data declarations
should be given.

To specify new initialisations for inherited members, use a constructor.

That's another way to solve it, so now I have 2 choices. Thanks.

Static members (functions or variables) don't override either AIUI. If
you need this for some type identification or similar, use a non-static
property instead.

This isn't what I need it for. RTTI would do this for me anyway, right? (I
have not used it yet)
Regan.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/