Thanks. That looks quite promising.
But it does not compile for me:
test.d(12): class test.Inner(alias outer) is used as a type
test.d(12): variable test.main.i1 voids have no value

Having each Inner class parameterized with an alias, is like having a
compile-time constant member (the outer variable). This poses some
restrictions though: the outer classes variables cannot be declared
inside functions (because variables inside functions cannot be used as
alias parameters),

I'm do not exactly understand that. Where can I find documentation on that?

and the Inner classes are no longer compatible
(covariant) with each other, although you can create a common Inner
superclass.

That's ok. I always had the perception that o1.Inner and o2.Inner are different
types.
coxalan

Thanks. That looks quite promising.
But it does not compile for me:
test.d(12): class test.Inner(alias outer) is used as a type
test.d(12): variable test.main.i1 voids have no value

Probably because he uses "Inner i[1234]" where he should use "Inner!(o[1234])
i[1234]". The easiest solution is to use "auto" on the left-hand side of the
assignments.
--
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi

One last question on this:
Is it possible to do the same with D version 1?
The current code comples with DMD v2.004, but with DMD 1.020 I get:
forum.d(16): Error: cannot modify final variable 'o1'
forum.d(17): Error: cannot modify final variable 'o2'
coxalan

Is it possible to do the same with D version 1?
The current code comples with DMD v2.004, but with DMD 1.020 I get:
forum.d(16): Error: cannot modify final variable 'o1'
forum.d(17): Error: cannot modify final variable 'o2'

Is it possible to do the same with D version 1?
The current code comples with DMD v2.004, but with DMD 1.020 I get:
forum.d(16): Error: cannot modify final variable 'o1'
forum.d(17): Error: cannot modify final variable 'o2'