We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import scala.annotation.tailrec object TestLazyTail { def main(args: Array[String]): Unit = (() => f(true))() @tailrec private def f(next: Boolean): Unit = { // Should always output 5! lazy val x = 5 println(x) if (next) f(false) else () } }
Output is:
5 0
Expected:
5 5
The necessary conditions I've found for this to show the issue:
Other aspects of this snippet don't seem to impact the result.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-9730?orig=1 Reporter: Branden Visser (mrvisser) Affected Versions: 2.11.8
Sorry, something went wrong.
@SethTisue said: got fixed along the way, somewhere during 2.12 development
No branches or pull requests
Output is:
5
0
Expected:
5
5
The necessary conditions I've found for this to show the issue:
Other aspects of this snippet don't seem to impact the result.
The text was updated successfully, but these errors were encountered: