Consider 2 types X and Y, and a function f defined as: class X, class Y and val f = { _:X → Y() }. In Kotlin, it’s possible to call the function f with a parameter of type X using invoke(): fun f(x: X) = Y() val y: Y = f.invoke(X()). The following calls the function f with a parameter of type X using invoke().