I get error highlighted in IDE. My suggestion was ...
# language-proposals
n
I get error highlighted in IDE. My suggestion was about recognizing this kind of construction and not get error there simple smile . Here is code:
Copy code
object Main {
    @JvmStatic fun main(args: Array<String>) {
        println("${testfun(100000)}")
    }

    fun testfun(input: Int): Int {
        tailrec fun numbersum(i: Int, acc: Int) = if (i == 0) acc else numbersum(i - 1, acc + i)
        return numbersum(input, 0)
    }
}