Reports tail recursive methods without @tailrec annotation which verifies that the method will be compiled with tail call optimization.

Note that a method must be effectively final for this inspection to be shown.

Example:


  def factorial(n: Long, acc: Long = 1): Long =
    if (n <= 1) acc else factorial(n - 1, acc * n)

After the quick-fix is applied:


  @tailrec
  def factorial(n: Long, acc: Long = 1): Long =
    if (n <= 1) acc else factorial(n - 1, acc * n)