val at = Array((1, 1.29), (1, 1.62), (1, 1.73), (3, 3.35), (3, 3.27), (5, 5.81))
at.groupBy(_._1).foreach(i => {
print("key : " + i._1 + " value-sum : " + (i._2.reduceLeftDouble => x + item._2.toDouble)))
println
})
报错:
Error:(116, 68) type arguments [Double] do not conform to method reduceRight's type parameter bounds [B >: (Int, Double)]
print("key : " + i._1 + " value-sum : " + (i._2.reduceRightDouble => x + item._2.toDouble)))
^