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

Don't emit line number for synthetic unit value #18717

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Oct 18, 2023

Synthetic () values are added to blocks without an expression. Don't emit a line number for them.

Implemented by checking the SyntheticUnit attachment. This seems simpler than trying to control the position assigned to synthetic unit trees, as they are created in many places.

Fixes #18320. Forward port of scala/scala#10577

Synthetic `()` values are added to blocks without an expression.
Don't emit a line number for them.

Implemented by checking the `SyntheticUnit` attachment. This seems
simpler than trying to control the position assigned to synthetic
unit trees, as they are created in many places.
@sjrd sjrd enabled auto-merge October 18, 2023 13:09
@sjrd sjrd added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Oct 18, 2023
@nicolasstucki nicolasstucki self-assigned this Oct 18, 2023
@sjrd sjrd merged commit b71c2d0 into scala:main Oct 18, 2023
17 checks passed
@lrytz
Copy link
Member Author

lrytz commented Oct 18, 2023

For the record, I noticed that javac does in fact emit a line number for the synthetic return, see scala/scala#10577 (comment). cc @vasilmkd

@vasilmkd
Copy link
Contributor

Thanks for the tag.

I actually did not know that javac also behaves that way.

Now I'm second guessing myself, if my original issue should have been opened in the first place.

@som-snytt
Copy link
Contributor

I think the rules for the children's game "20 questions" apply, so you are still good.

@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
WojciechMazur added a commit that referenced this pull request Jun 22, 2024
…0723)

Backports #18717 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
@WojciechMazur WojciechMazur removed the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 8, 2024
# 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.

Assignment as the final statement in a block emits an additional debug line/breakpoint
7 participants