-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Tailrec improvements #5399
New issue
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
Tailrec improvements #5399
Conversation
edcbf99
to
ff730ca
Compare
compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala
Outdated
Show resolved
Hide resolved
compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
Outdated
Show resolved
Hide resolved
ff730ca
to
089eb40
Compare
The optimization is incorrect. It is possible to re-enter a tail-pos context even from some places where we are in a non-tail-pos context. The most important example is when finding a |
3eca547
to
f8f2b4e
Compare
f8f2b4e
to
e823e8b
Compare
A while loop condition or body is not in tail position.
e823e8b
to
ac42ec0
Compare
We can stop traversing a tree in Tailrec as soon as we are not in tail position anymore and we are not within a labeled block in tail position. We keep traversing the tree however if the method is @tailrec annotated to report errors on eventual recursive calls.
ac42ec0
to
a129cbd
Compare
No description provided.