Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 4 commits into from
Jun 26, 2024

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
@sjrd sjrd merged commit 796a7b9 into main Jun 26, 2024
37 checks passed
@sjrd sjrd deleted the fix/if-positions branch June 26, 2024 09:34
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
WojciechMazur added a commit that referenced this pull request Jul 10, 2024
…nditions" to LTS (#21147)

Backports #20431 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
# for free to join this conversation on GitHub. Already have an account? # 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
3 participants