3 ms·
Sounds like you are confused about what @tailrec does. @tailrec is not necessary to enable tailcalls. All the annotation does is error if a function is not ab
by kod 8y ago
Sounds like you are confused about what @tailrec does.
@tailrec is not necessary to enable tailcalls.
All the annotation does is error if a function is not able to be optimized for tail calls.
The (attempt at) optimization takes place either way, you don't need the annotation unless there's some doubt in your mind.