Question
What does the @tailrec annotation provide?
Select an option. Your answer will be checked instantly.
Correct Answer: B. A compile-time check that a method is tail recursive
Explanation:
Compilation fails if the recursive call cannot be optimized as tail recursion.
The annotation documents and enforces the intended structure.
Leave a Reply