On Sat, 24 Aug 2024 at 13:36, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
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.

I logged a bug... and then after I did, I realised that I had already logged one before; so you've got 2 now! That should be twice the motivation to fix it ;)

I have moved on... but the reason I bring it up is because it's a cool advertised feature, and for the first time in my life, I had a situation where it seemed immensely useful!