Skip to content

Drop invalid assumption from TastyUnpickler #23353

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

Merged
merged 1 commit into from
Jul 3, 2025
Merged

Conversation

Jentsch
Copy link
Contributor

@Jentsch Jentsch commented Jun 11, 2025

Fixes #22265

I'm actually not sure if the scaladox-testcases sub-project is the right place for the test. In sbt scaladoc/test fails the dotty.tools.scaladoc.tasty.comments.MemberLookupTests.

@Gedochao Gedochao requested a review from jchyb June 12, 2025 07:40
@jchyb
Copy link
Contributor

jchyb commented Jun 17, 2025

Hi @Jentsch. Thank you for submitting the fix. I will admit I'm a little uncomfortable with just removing the assertion in Tasty Unpickler. It does seem like the compiler pickles incorrect stuff to begin with. Running scalac -print-tasty breaks.tasty reveals that there is a recorded source change on the inlined IMPORT node (which does not really make sense, as it should be on the outer BLOCK node):

    92:               BLOCK(11) // source change, in my opinion, should be recorded here
    94:                 UNITconst
    95:                 IMPORT(8) // source change was recorded here
    97:                   TERMREF 24 [List]
    99:                     TERMREF 25 [package]
   101:                       SHAREDtype 56
   103:                   IMPORTED 26 [empty]

I'll try to take a closer look into this in the coming days

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.

Sorry for the misleading message earlier, and thank you for waiting. It seems this is the only sensible solution (as tested/discussed in #23397). Thank you for the contribution!

@jchyb jchyb merged commit c0f8d70 into scala:main Jul 3, 2025
29 checks passed
@Jentsch Jentsch deleted the fix-22265 branch July 3, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants