When inside a class or function, we often want to refer to the enclosing instance. For example, an instance may want to invoke a method passing itself as an argument. To do this, we use the this keyword:
class Person(name: String) { fun printMe() = println(this) }
In Kotlin terminology, the reference referred to by the this keyword is called the current receiver. This is because it was the instance that received the invocation of the function. For example, if we have a string and invoke the length, the string instance is the receiver.
In members of a class, this refers to the class instance. In extension functions, this refers to the instance that the extension function was applied to.