Why it is not a tail recursion?
问题 I have the following code, that I do not understand, why it is not a tail recursion: override fun drop(n: Int): List<A> = if (n == 0) this else tail.drop(n - 1) whereas this is a tail recursion: fun drop(n: Int): List<A> { tailrec fun drop(n: Int, list: List<A>): List<A> = if (n <= 0) list else when (list) { is Cons -> drop(n - 1, list.tail) is Nil -> list } return drop(n, this) } Why is the first example not a tail recursion? 回答1: It isn't tail recursion because Kotlin checks the recursive