title: Why would the Scala compiler consider a type, and the type of a value assigned it to be different?
body: <p>I have a simple class representing vectors, such that vectors of different lengths resolve to different types. However, I'm having some difficulties implementing the zip method. Here's a minimalised version of what I have done, and the compiler message which I find a little mysterious.</p>
  <pre><code>  sealed trait Vector[A] {
  
      type ThisButType[B] &lt;: Vector[B]
  
      def zip[B](other: ThisButType[B]): ThisButType[Tuple2[A, B]]
    }
  
    case class Term[A]() extends Vector[A] {
     
      type ThisButType[B] = Term[B]
     
      def zip[B](other: ThisButType[B]): ThisButType[Tuple2[A, B]] = Term[Tuple2[A, B]]()
    
    }
  
    case class Component[A, T &lt;: Vector[A]](value: A, tail: T) extends Vector[A]{
  
      type ThisButType[B] = Component[B, T#ThisButType[B]]
  
      def zip[B](other: ThisButType[B]): ThisButType[Tuple2[A, B]] =
        Component[Tuple2[A,B], T#ThisButType[Tuple2[A, B]]]((value, other.value), tail.zip(other.tail))
    }
  </code></pre>
  <p>The error I get is:</p>
  <pre><code> type mismatch;
     found   : other.tail.type (with underlying type T#ThisButType[B])
     required: Component.this.tail.ThisButType[B]
  </code></pre>
  <p>How come the compiler can't figure out that <code>T</code> should be considered the same as <code>Component.this.tail</code> in this instance?</p>