TL DR yes we can
Firstly, there is no point in parameterizing such a method
infix fun <U> Int.foo(i: Int) = ...
since foo never uses a parameter of type U , the types of callers and arguments are defined
When parameterizing a method, you connect the signature type to it with a common parameter, for example
infix fun <U> U.foo (other: U) = ...
or at least one of them
infix fun <U> Int.foo (other: U) = ... infix fun <U> U.foo (other: Int) = ...
The compiler guesses type U by arguments and / or object types of the calling object
In your case, the compiler cannot guess the type of U , because it is not connected to either the caller or the argument
source share