I have created the following function:
def mapToPers(inTuple: (String, String, String),
v: ((Double, Double, Double, Double, Double),
Map[Double,
(Double, Double, Double, Double, Double)])) = {
val (prod: String, market: String, week: String) = inTuple
val result = for (cumePeriod <- cumePeriods) yield {
val (per, weekList) = cumePeriod
if (weekList.contains(week)) ((prod, market, per), v)
}
result
}
When I call it, it gives error of type mismatch:
Description Resource Path Location Type type mismatch; found : ((String, String, String), ((Double, Double, Double, Double, Double), Map[Double,(Double, Double, Double, Double, Double)])) => scala.collection.immutable.Iterable[Any] required: (((String, String, String), ((Double, Double, Double, Double, Double), Map[Double,(Double, Double, Double, Double, Double)]))) => TraversableOnce[?]
println(inTuple)
andprintln(cumePeriods)
. Also from where doesv
come from? – Onilton Macielcase class
for each of them. It much easier to bug fix/investigate. – vvg