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

Avoid stacked thisCall contexts #20488

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Avoid stacked thisCall contexts #20488

merged 1 commit into from
Jun 10, 2024

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 28, 2024

AddImplicitArgs can recursively add several implicit parameter lists. We need to make sure we don't perform a thisCallContext search in another thisCall context in this case.

Fixes #20483

The original code would back out further and further in the context chain for every implicit parameter section on the secondary constructor. Eventually (in this case after 2 times) bad things happen.

AddImplicitArgs can recursively add several implicit parameter lists.
We need to make sure we don't perform a thisCallContext search in another
thisCall context in this case.

Fixes scala#20483

The original code would back out further and further in the context chain for every
implicit parameter section on the secondary constructor. Eventually (in this case
after 3 times) bad things happen.
Copy link
Member

@mbovel mbovel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@odersky odersky added this to the 3.5.0-RC2 milestone Jun 10, 2024
@odersky odersky merged commit dea3d10 into scala:main Jun 10, 2024
19 checks passed
@odersky odersky deleted the fix-20483 branch June 10, 2024 14:53
@WojciechMazur WojciechMazur added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Jun 19, 2024
WojciechMazur added a commit that referenced this pull request Jul 9, 2024
Backports #20488 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
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler crash when secondary constructor has 3 or more implicit parameters
3 participants