Scala pattern matching for vararg
<p>I'm just trying to do some hands on on scala and tried to implement List.concat function on my own . Here is the code </p>

<pre><code>  def concat[A](lists : Traversable[A]*):List[A]={
    println("concat called")
    lists match {
      case Nil =&gt; Nil
      case x :: Nil =&gt; (x :\ List.empty[A])((elem,list)=&gt; elem::list)
      case x:: xs =&gt; (x :\ concat(xs:_*))((elem,list)=&gt; elem :: list)
    }
  }
</code></pre>

<p>However when i try to call this method like </p>

<pre><code>concat(List(1,2,3),List(2,3,4),List(4,5,6),List(6,7,8))
</code></pre>

<p>I get error </p>

<pre><code>Exception in thread "main" scala.MatchError: WrappedArray(List(1, 2, 3), List(2, 3, 4), List(4, 5, 6), List(6, 7, 8)) (of class scala.collection.mutable.WrappedArray$ofRef)
</code></pre>

<p>Can someone explain what i did wrong here ? 
Thanks in advance</p>