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.
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.
Create a free account to access the full topic