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

Further clean up the Scala 2 pickle reader. #422

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

sjrd
Copy link
Contributor

@sjrd sjrd commented Dec 14, 2023

No description provided.

We only need the `typeParams` when completing the type of
constructors, and the types of constructors are not needed by the
class. Therefore, we can move reading `typeParams` until completing
the type of the class.

This simplifies things, because previously we were doing a sort of
look-ahead inside the `POLYtpe`, which also required having a
special non-caching version of `at()`. Now we can genuinely read
the `POLYtpe` and extract the type parameters from it after the
fact.
Now that types are read afterwards, including class type
parameters, there are no more cyclic dependencies while creating
symbols. Therefore, we can get rid of the all the machinery that
supported eagerly filling in the `entries` from within
`readMaybeExternalSymbol()`.
Previously, we tried to write "generic" code for handling all the
special cases to apply to names and flags. However, that was making
the logic harder than necessary, with too many possible branching
paths.

We now move that logic inside the various `case`s of `tag match`.
This makes the logic simpler overall.
@sjrd sjrd requested a review from adpi2 December 14, 2023 13:01
@sjrd sjrd merged commit b75f3e5 into scalacenter:main Dec 14, 2023
4 checks passed
@sjrd sjrd deleted the further-cleanup-pickle-reader branch December 14, 2023 14:16
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.

2 participants