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

Fix inline match on blocks with multiple statements #20125

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Apr 8, 2024

Only the last expression of the block is considered as the inlined scrutinee. Otherwise we may not reduce as much as we should. We also need to make sure that side effects and bindings in the scrutinee are not duplicated.

Inlined are converted into blocks to be able to apply the previous semantics without breaking the tree source files.

Fixes #18151

Only the last expression of the block is considered as the inlined
scrutinee. Otherwise we may not reduce as much as we should. We also
need to make sure that side effects and bindings in the scrutinee are
not duplicated.

Fixes scala#18151
@nicolasstucki nicolasstucki self-assigned this Apr 8, 2024
@nicolasstucki nicolasstucki marked this pull request as ready for review April 9, 2024 07:36
@nicolasstucki nicolasstucki assigned jchyb and unassigned nicolasstucki Apr 9, 2024
@nicolasstucki nicolasstucki requested a review from jchyb April 9, 2024 07:37
Copy link
Contributor

@jchyb jchyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Only found one NIT in the leftover test case assertion message

@nicolasstucki nicolasstucki merged commit d71a347 into scala:main Apr 10, 2024
16 checks passed
@nicolasstucki nicolasstucki deleted the fix-18151 branch April 10, 2024 09:31
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
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.

Transparent inline codes causing compiler assertion error during pickling tree phase
3 participants