and it does complain if I do something like `tailr...
# arrow
b
and it does complain if I do something like
tailrec suspend fun factorial(n) = if(n == 1) { 1 } else { n * factorial(n - 1) }
p
Is that tailrec? It does something with the function return.
b
the ^^ factorial function above is not tailrec for exactly that reason as far as I'm aware
the function I traced was tailrec for sure: just
tailrec suspend fun foo(n) = if (n == 1) { 1 } else { foo(n-1) }
then
foo(700000)
and watched the stack trace of the thread in IJ debugger with a breakpoint on `foo(n-1)`; stack depth stayed constant
p
👍🏼