Skip to content

Fix #7426: Set correct default source for unpickling #8099

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
Jan 28, 2020

Conversation

liufengyun
Copy link
Contributor

Fix #7426: Set correct default source for unpickling

Note that we cannot use `classRoot.unforcedAnnotation(defn.SourceFileAnnot)`
because it's not loaded yet.

Nor can we use `SourceFile` in classfile attributes like the following:

      val sourceFile: SourceFile =
        if scan(tpnme.SourceFileATTR) then
          val attrLen = in.nextInt
          SourceFile.virtual(pool.getName(in.nextChar).toString, "")
        else NoSource

This is because `SourceFile` is classfile attributes only contains the file name,
while the `SourceFile` in TASTY contains the full path.
@nicolasstucki nicolasstucki merged commit 7992aca into scala:master Jan 28, 2020
@nicolasstucki nicolasstucki deleted the fix-7426 branch January 28, 2020 08:43
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.

-Yretain-trees and -Ycheck:all crashes compiler
2 participants