Can someone explain me what exactly is going on here? I am not fully getting into it right now:
val s = Seq(1D,2D,3D,4D)
case class WithUnit(value: Double, unit: String)
s map { WithUnit(_,"cm") } // works
s map { WithUnit(value = _ , unit = "cm") } // error: missing parameter type for expanded function ((x$2) => value = x$2)
I guess the compiler can´t infer the parameter type because I wrote the name of the argument. But why not? It shouldn´t be more difficult only because of stating the name of the argument?!
Thanks!