We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
The following example shows that implicit functions and tail recursion do not seem to get along very well
$ dotr Starting dotty REPL... scala> @annotation.tailrec def foo(i: Int): Int = if (i == 0) { 0 } else { foo(i - 1) } // ok def foo(i: Int): Int scala> @annotation.tailrec def bar(i: implicit Unit => Int): implicit Unit => Int = if (i == 0) { 0 } else { bar(i - 1) } // ko 1 |@annotation.tailrec def bar(i: implicit Unit => Int): implicit Unit => Int = if (i == 0) { 0 } else { bar(i - 1) } // ko | ^ | TailRec optimisation not applicable, method not tail recursive scala>