title: Qualifying an inner trait's method so that it is private from the outside but accessible from the inside
body: <p>I would like to qualify a method of an inner trait so that it can only be accessed by subclasses of the outer trait. E.g.:</p>
  
  <pre><code>trait Tree[A] {
    trait TNode {
      final def prevOption: Option[TNode] = Option(prev)
      protected[Tree] def prev: TNode // !
    }
  
    def test(n: TNode): Option[TNode] = Option(n.prev)
  }
  </code></pre>
  
  <p>How can I modify the qualifiers of <code>prev</code>, so that the following <strong>does</strong> compile:</p>
  
  <pre><code>trait TreeImpl[A] extends Tree[A] {
    def test2(n: TNode): Option[TNode] = Option(n.prev)
  }
  </code></pre>
  
  <p>While this <strong>does not</strong> compile:</p>
  
  <pre><code>def test3[A](t: Tree[A]#TNode) = t.prev
  </code></pre>
  
  <p>(that is to say, a public <code>def prev: TNode</code> is not an option).</p>