Overload-ambiguity lambda parametercount

It is very unlikely that the compiler could. If you leave of the parameter type, the compiler only has the following to work with:

fun onChange(lambda) = lambda("first")
fun onChange(lambda) = lambda("first", "second")

Inferring the type of the parameters of the lambdas won’t be a problem: String, but what is the return type of the lambdas? The only safe choice would be defaulting to Unit, I guess.

But even if the compiler could do it, explicit parameter types are needed for acceptable compiler performance according to Why can not type of function parameters with default value be omited?.

Note: You don’t have to specify parameter names for function types. The following is equivalent to your code:

fun onChange(lambda: (String)->Unit) = ...
fun onChange(lambda: (String, String)->Unit) = ...