Skip to content

Instantly share code, notes, and snippets.

@jrudolph
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrudolph/d5213d32d425fce0d88a to your computer and use it in GitHub Desktop.
Save jrudolph/d5213d32d425fce0d88a to your computer and use it in GitHub Desktop.
@tailrec gets short-circuited
import scala.annotation.tailrec
object Failrec {
def main(args: Array[String]): Unit = run()
def run() =
{
@tailrec def rec(count: Long): Boolean =
if (count == 0) true else rec(count - 1)
rec(1000000L)
} && true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment