Last active
August 29, 2015 14:02
-
-
Save jrudolph/d5213d32d425fce0d88a to your computer and use it in GitHub Desktop.
@tailrec gets short-circuited
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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