I'm taking my first interesting steps (non-hello-world level) with Scala (2.9.1) and I'm stuck trying to understand a very uninformative error message. It goes much like this:
error: type mismatch;
found : (Int, Array[InputEntry]) => (Int, Double)
required: (Int, Array[InputEntry]) => ?
entries.groupBy(grouper).map((k: Int, ies: Array[InputEntry]) => (k, doMyStuff(ies)))
As you can guess process in this snippet is supposed to be where some processing goes on, and it's actually a well defined function with signature Array[InputEntry] => Double.
Grouper's signature, instead, is Array[InputEntry] => Int.
I've tried to extract a function and replace the lambda but it was useless, and I'm stuck trying to understand the question mark in the error...
Any ideas?
Edit: I should clarify that InputEntry is a class I've defined, but for the sake of this example it seems to me like it's hardly relevant.
doMyStuff, and what kind of variable are you trying to write the result to?required: ((Int, List[InputEntry])) => ?