Aha, indeed.
I was thinking more of something like this:
open class C1 { type T }
open class C2: C1() { type T = Foo }
which would be semantically equivalent to:
open class _C1<T>
open class _C2<T: Foo>: _C1<T>()
given that each occurrence of C1
is replaced by _C1<out Any>
and each occurrence of C2
by _C2<out Foo>
(or _C2<Foo>
if C2
were final).
(In fact it would be even better to introduce two notations: type T < Foo
and type T = Foo
were the former would behave as in the example, and the latter would allow removing the covariance while keeping the class open, fixing T
to Foo
for all derived classes.)