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 #20471: owners of top-level symbols in cached quoted code being incorrect #21945

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Nov 13, 2024

Closes #20471
I would just reopen #21932, but it looks like that's disallowed after force pushing... (apologies for the spam)

@jchyb jchyb marked this pull request as ready for review November 14, 2024 10:38
@jchyb jchyb requested a review from hamzaremmal November 14, 2024 10:39
Comment on lines +244 to +246
val treeCpy = TreeTypeMap(oldOwners = List(owner), newOwners = List(owner)).apply(tree)
// Then replace the symbol owner with the one pointed by the quote context.
treeCpy.changeNonLocalOwners(ctx.owner)
Copy link
Member

Choose a reason for hiding this comment

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

I was curious why not propose this change, I've tried it locally with the test for #20471 but the following test (and only one) tests/run-staging/quote-ackermann-1.scala fails.

Suggested change
val treeCpy = TreeTypeMap(oldOwners = List(owner), newOwners = List(owner)).apply(tree)
// Then replace the symbol owner with the one pointed by the quote context.
treeCpy.changeNonLocalOwners(ctx.owner)
TreeTypeMap(oldOwners = List(owner), newOwners = List(ctx.owner)).apply(tree)
// Then replace the symbol owner with the one pointed by the quote context.
//treeCpy.changeNonLocalOwners(ctx.owner)

@hamzaremmal hamzaremmal merged commit 2a62152 into scala:main Nov 18, 2024
29 checks passed
@hamzaremmal hamzaremmal deleted the fix-i20471-change-owners branch November 18, 2024 09:19
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Nov 25, 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.

Symbol.asQuotes doesn't work as advertised
3 participants