Method overloading type resolution for passing lambda type

Not sure if this is a compiler bug but the following pattern leads to method resolution error messages:

fun foo(getter: (Email) -> User, block: (User) -> Unit) = // function body that uses the getter and then calls the block with the result

class Getter {
    fun by(email: Email): User
    fun by(id: Id): User
}

val getterInstance = Getter()
foo(getterInstance::by) {...}  // ERROR method signature can't be resolved

I’m curious why the compiler can’t figure out how to resolve the method signature given that the function taking it has a type that matches the fun by(email: Email): User signature.

what am i missing here?

What version of Kotlin? It should work: Kotlin Playground: Edit, Run, Share Kotlin Code Online

thanks for your reply, it is much appreciated. this is very strange because it works in the playground. i need to look back at my code and figure out what is different from my toy example. i think there might be another layer of indirection in the real code this is based off. i will update with that soon.