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
The following tail recursive function is not optimized when using -Yvirtpatmat
-Yvirtpatmat
def f[T](l: List[T]): Int = l match { case x :: xs => f(xs) case Nil => 0 } f(List.fill(10000)(0))
will cause a stack overflow.
Also when using @annotation.tailrec the compiler will report that f contains a call not in tail position.
@annotation.tailrec
f
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-5394?orig=1 Reporter: huynhjl Affected Versions: 2.10.0 Other Milestones: 2.10.0
Sorry, something went wrong.
@retronym said: Fixed in scala/scala@cd3d342. I'm not sure if there is a test case.
@soc said: Now there is: scala/scala#543
Thanks!
@soc said: Closing after test is merged in scala/scala@5797aab.
adriaanm
No branches or pull requests
The following tail recursive function is not optimized when using
-Yvirtpatmat
will cause a stack overflow.
Also when using
@annotation.tailrec
the compiler will report thatf
contains a call not in tail position.The text was updated successfully, but these errors were encountered: