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

Make sure symbols in annotation trees are fresh before pickling #22002

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

mbovel
Copy link
Member

@mbovel mbovel commented Nov 21, 2024

In a nutshell: when mapping annotated types, we can currently end up with the same symbol being declared in distinct trees, which crashes the pickler as it expects each symbol to be declared in a single place. See #19957 (comment) and #19957 (comment) for more context.

This PR ensures that all symbols in annotation trees are different by creating fresh symbols for all symbols in annotation tree during PostTyper.

In my previous attempt which was discussed on #19957, I did it in Annotations.mapWith. Here, it's only done once in PostTyper, so this is more lightweight.

Fixes #17939, fixes #19846 and fixes (partially?) #20272.

@mbovel

This comment was marked as outdated.

@mbovel mbovel requested a review from odersky December 5, 2024 13:48
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

LGTM

@odersky odersky merged commit ae80285 into scala:main Dec 17, 2024
29 checks passed
@WojciechMazur WojciechMazur added this to the 3.6.4 milestone Jan 16, 2025
@mbovel mbovel deleted the mb/annots/pickle-fresh-symbols branch January 16, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants