Receivers

Report a typo

Consider the following code:

fun Double.addInt(i: Int) = this + i.toDouble()

val result = 5.5.addInt(10)

What is a receiver type here and what is a receiver object?

Write an answer like this: A#B, where A is the type and B is the object.

Enter a short text
___

Create a free account to access the full topic