I use kotlin 1.1.2-2
I want to call top-level function plus100(Int):Int
from method Mul2.plus100(Int):Int
. I tried to do this in the following code but actually Mul2.plus100
itself is called.
class Mul2 {
fun plus100(v: Int): Int = plus100(2 * v)
}
fun plus100(v: Int): Int = v + 100
fun main(args: Array<String>) {
val v = Mul2()
println(v.plus100(10)) // expected: "120", actual: StackOverflowError
}
Is there anyway to access plus100
from Mul2.plus100
?