-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Improve position of tailcalls diagnostic #10723
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
Conversation
ece451c
to
5ecfa88
Compare
5ecfa88
to
a914532
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Instead of a Sentiment on the dotty ticket is against diluting |
I'll rework this to align with Dotty. |
a914532
to
52130d7
Compare
Drop the |
52130d7
to
2a48f82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise, nice improvements!
def recursiveCalls(t: Tree): List[Tree] = detectRecursion.recursiveCalls(t) | ||
def isRecursiveCall(sym: Symbol): Boolean = (method eq sym) && tailPos | ||
|
||
def containsRecursiveCallCandidate(t: Tree): Boolean = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused, can be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed code for -Wstrict
mode; probably I didn't delete enough.
I should've asked copilot...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I had previously refactored that away but didn't delete it. It was still used in the original PR commit. I have a vague memory that 2.13.16 pre-checks for "candidates" (hence the name) but I thought why do that. (The Giants won yesterday but they are losing badly to the Dodgers already tonight. Should I just code instead of listening to the game?) (6-0 is a bad tennis score and a worse baseball score.)
for ((p, a) <- fun.symbol.paramLists.head.lazyZip(args)) | ||
traverse(a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for ((p, a) <- fun.symbol.paramLists.head.lazyZip(args)) | |
traverse(a) | |
args.foreach(traverse) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saved the branch which previously said if strict || !p.isByNameParam
...
2a48f82
to
3cebe3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I added |
Fixes scala/bug#4649
The diagnostic is as intended, so the OP is wont-fix, but improve error position and also an incorrect message, and move the
pos
test toneg
.