Skip to content

Remove compilation units for classes that have already been loaded #3700

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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ class ReadTastyTreesFromClasses extends FrontEnd {
else {
val unit = CompilationUnit.mkCompilationUnit(clsd, unpickled, forceTrees = true)
val cls = clsd.symbol.asClass
unit.pickled += (cls -> cls.unpickler.unpickler.bytes)
cls.unpickler = null
Some(unit)
if (cls.unpickler == null) None // Has already been loaded by some other compilation unit
Copy link
Member

Choose a reason for hiding this comment

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

Maybe make it an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and done

else {
unit.pickled += (cls -> cls.unpickler.unpickler.bytes)
cls.unpickler = null
Some(unit)
}
}
}
}
Expand Down