title: Scala: Matching empty sequence against Nil
body: <p>Why does the following:</p>
  
  <pre><code>val x: Seq[Any] = Vector.empty
  x match {
   case Nil =&gt; 1
   case _ =&gt; 2
  }
  </code></pre>
  
  <p>where <code>Vector.empty</code> internally equates to:</p>
  
  <pre><code>private[immutable] val NIL = new Vector[Nothing](0, 0, 0)
  override def empty[A]: Vector[A] = NIL
  </code></pre>
  
  <p>match <code>Nil</code> and return <code>1</code>? Isn't <code>Nil</code> only a specific subtype of <code>Seq</code>?</p>
  
  <p>The answer remains the same if I use the more generic <code>Seq.empty</code>. Why is that?</p>