Skip to content

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

Open
wants to merge 1 commit into
base: 2.13.x
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Mar 22, 2024

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 to neg.

@scala-jenkins scala-jenkins added this to the 2.13.15 milestone Mar 22, 2024
@som-snytt som-snytt marked this pull request as draft March 22, 2024 21:30
@som-snytt som-snytt force-pushed the issue/4649-tailrec-byname branch 2 times, most recently from ece451c to 5ecfa88 Compare March 23, 2024 18:58
@som-snytt som-snytt marked this pull request as ready for review March 23, 2024 20:05
@som-snytt som-snytt force-pushed the issue/4649-tailrec-byname branch from 5ecfa88 to a914532 Compare March 26, 2024 02:47
@som-snytt

This comment was marked as resolved.

@som-snytt
Copy link
Contributor Author

Instead of a -W, how about @notailrec to indicate "I did not intend this expression as a tail call and I know what I'm doing."

Sentiment on the dotty ticket is against diluting @tailrec.

@som-snytt som-snytt marked this pull request as draft March 28, 2024 00:35
@som-snytt
Copy link
Contributor Author

I'll rework this to align with Dotty.

@SethTisue SethTisue modified the milestones: 2.13.15, 2.13.16 Aug 14, 2024
@som-snytt som-snytt closed this Sep 11, 2024
@som-snytt som-snytt reopened this Nov 9, 2024
@SethTisue SethTisue modified the milestones: 2.13.16, 2.13.17 Dec 12, 2024
@som-snytt som-snytt changed the title Tailcalls is more selective when reporting self-recursion Tailcalls is more selective when reporting self-recursion [ci: last-only] Jun 2, 2025
@som-snytt som-snytt force-pushed the issue/4649-tailrec-byname branch from a914532 to 52130d7 Compare June 2, 2025 17:39
@som-snytt
Copy link
Contributor Author

Drop the -W; but the title should be "improve position in tailrec diagnostic", which may be worthwhile.

@som-snytt som-snytt force-pushed the issue/4649-tailrec-byname branch from 52130d7 to 2a48f82 Compare June 3, 2025 20:51
@som-snytt som-snytt changed the title Tailcalls is more selective when reporting self-recursion [ci: last-only] Improve position of tailcalls diagnostic Jun 3, 2025
@som-snytt som-snytt marked this pull request as ready for review June 3, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible regression in 2.9: @tailrec annotated method rejected by scalac
3 participants