Outer class reference oddity?
Walter Bright
newshound2 at digitalmars.com
Sat Aug 24 03:31:59 UTC 2024
The reason the inner class feature exists is to support translation from Java
code which used inner classes. (It doesn't exist in C++.)
Ok, so there is only one outer. This illustrates how confusing this example is
(at least to me!)
> it is typed as the base type, and not as the derived type which was assigned
on creation.
It is indeed typed as the static type, not the dynamic type.
I encourage you to submit it to bugzilla.
I suggest just adding the Outer2 qualification, and move on. Or use an alternate
method such as interfaces or aggregation.
More information about the Digitalmars-d
mailing list