You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
@tailrec
private def f(x: Widget, token: Option[String] = None): Boolean = {
if (foo) true
else Option(x.getNextToken) match {
case None => false
case Some(tok) => f(x, Some(tok))
}
}
When a method is marked @tailrec, the linter should not trigger, since rewriting creates a non-tail-recursive function
Option(x.getNextToken).exists(t => f(x, Some(t))
This is "morally" tail recursive, but the type checker can't tell. (I didn't look at the bytecode to see if it gets compiled to a tail recursive function.)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Consider
When a method is marked @tailrec, the linter should not trigger, since rewriting creates a non-tail-recursive function
This is "morally" tail recursive, but the type checker can't tell. (I didn't look at the bytecode to see if it gets compiled to a tail recursive function.)
The text was updated successfully, but these errors were encountered: