So, as @omnomnom says, you can check whether something is being TCO-ed by adding the @tailrec
annotation to the method. The compiler will throw an error if it's unable to optmise it.
We can verify this with a simple example:
@tailrec
def fact(n : Int) : Int = fact(n - 1) * 2
The compiler bombs out with the following error:
test.scala:6: error: could not optimize @tailrec annotated method fact: it contains a recursive call not in tail position
Trying this on your program, however, the answer is... yes! So apparently the compiler is happy to optimise your tail-call away :-)