I can extend an inner class/trait inside the outer class or inside a class derived from the outer class. I can extend an inner class of a specific instance of an outer class as in:
class Outer
{
class Inner{}
}
class OtherCl(val outer1: Outer)
{
class InnA extends outer1.Inner{}
}
Note: even this seems to compile fine producing very interesting possibilities:
trait OuterA
{ trait InnerA }
trait OuterB
{ trait InnerB }
class class2(val outerA1: OuterA, val outerB1: OuterB)
{ class Inner2 extends outerA1.InnerA with outerB1.InnerB }
But this won't compile:
class OtherCl extends Outer#Inner
As far as I can see I'm trying to extend a parametrised class where the type parameter is an instance of the outer class so something to the effect of
class OtherCl[T where T is instance of Outer] extends T.Inner
So is the anyway to extend an inner class/ trait that's inside an outer trait/class without reference to the outer trait/class?
I am not looking to instantiate the derived inner class without an instance of the outer class only declare its type.