In previous part we’ve already described difference between object and type. Similar differentiation is used for receivers in extension functions. Let’s look at the example:

fun String.isBlank() = trim() == “” “Marcin”.isBlank()

In above usage “Marcin” is an object passed to extension function. Inside this function it is called Receiver object. Receiver object is a different kind of an argument. Function defines extended type as String , so inside this function String is called Receiver type.

Note that correct term is Receiver type, not receiver class. It is important because extension functions are actually extensions to types, not to the classes. This is one of the big differences between methods and extension functions. Thanks to that we can define extension to nullable or generic types generated by the class: