So I have some data:
val data = Array[(Array[String], Long)]
Which is an array of pairs, where each pair consists of another array and a number. I have created a ListBuffer as follows:
var x = ListBuffer[(Array[String], Long)]
I would like to append an element at some index i to x. I do the following:
x += data(i)
However, I get the error:
Type mismatch, expected: String, actual: (Array[String], Long)
What am I doing wrong? I am working in IntelliJ and Scala 2.10.7.
Also this example (which is a concrete example (I cannot provide the original example)) also gives the same error:
val xData = ListBuffer[(Array[String], Long)]
var x = ListBuffer[(Array[String], Long)]
x += xData(0)