In https://kotlinlang.org/docs/reference/lambdas.html#function-types it says
Blockquote
Non-literal values of function types with and without receiver are interchangeable
I want to discuss similar interchangeability further:
class X {
public fun toInt() = 0;
}
typealias SX1 = (X)->Int;
typealias SX2 = X.()->Int;
var to1:SX1 = X::toInt
var to2:SX2 = X::toInt
to2(with receiver signature) can be invoked using both ways:
val i1=to2(x1)
val i2=x1.to2();
but to1 (with first parameter signature) can be used only:
val i3=to1(x1)
But these doesn’t work:
val i4=x1.to1();
Can one commnet why this limitation, what it breaks if it is allowed ?
(English Isn’t my language, sorry)
Thanks
Boaz