When does Scala need parameter types for anonymous and expanded functions?
问题 When does the Scala compiler really need the type information of parameters of anonymous functions? For instance, given this function: def callOn[T,R](target: T, f: (T => R)) = f(target) then I cannot use it like this: callOn(4, _.toString) => error: missing parameter type for expanded function ((x$1) => x$1.toString) and I have to specify callOn(4, (_: Int).toString) which is rather ugly. Why doesn't my example work, whereas method like map, filter, foldLeft, etc. on the collection classes