The main difference is that if you have
class Outer {
class Inner {
def foo(x: Inner): Inner = this
}
}
and two instances Outer:
val a = new Outer
val b = new Outer
then a.Innerand b.Inner- two different types (which in Java they would be Outer.Inner), so you can not do
val aInner = new a.Inner
val bInner = new b.Inner
aInner.foo(bInner)
They have a common supertype that is written Outer#Inner.
source
share