Using below code I'm trying to sum the Double values

```
val v: List[(String, Array[((String, String), Double)])] = List( ("a" , Array((("a" , "b") , 1.0) , (("a" , "c") , 2.0) , (("a" , "d") , 3.0) , (("b" , "c") , 1.0) , (("b" , "d") , 4.0) , (("c" , "d") , 3.0))) )

def sum(xs: Array[((String, String), Double)]): Double = {

  @scala.annotation.tailrec
  def inner( xs:Array[((String, String), Double)] , accum: Double) : Double = {
    xs match {
      case x :: tail => inner(tail, accum + x._2)
      case Nil => accum
    }
  }
  inner(xs, 0)

}

```

But error : 

```
Multiple markers at this line - constructor cannot be instantiated to expected type; found : 
 scala.collection.immutable.::[B] required: Array[((String, String), Double)] - not found: value tail - constructor 
 cannot be instantiated to expected type; found : scala.collection.immutable.::[B] required: Array[((String, String), 
 Double)] - not found: value x

```

is thrown.

Is my logic not correct ?