trait A { trait B { def foo: A.this.B = new B{} def bar: A#B = foo def baz: A.this.B = bar // type mismatch; found : A#B required: A.this.B }
Yes, it's a path dependent type. Yes, all instances of B are members of A#B. Note that you can't directly construct an instance of A#B, all instances of B must have a reference to the outer A instance