Skip to content
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

Improve source positions emited for synthetic unit in if-conditions #20431

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

WojciechMazur
Copy link
Contributor

Fixes #18238

Source positions (lines) emitted for synthetic unit in if-conditions were incorrect, because they were missing explicit line position for the else condition (introduced by the compiler as synthetic unit) the debugger when stepping into the else branch it was using the last position of the then expression. Now, we explicitly use the line position of the condition for the synthetic else branch - it matches the behaviour of Scala 2.

  • Use SyntheticUnit and introduce untpd.syntheticUnitLiteral to detect if else branch is defined - allows to emit correct positions for the explicit unit else branch

@WojciechMazur WojciechMazur requested a review from sjrd May 18, 2024 11:36
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.

Wrong debug information emitted in a while loop and if statement combination
1 participant