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

Do not enter Scala 2 extension methods and let dotty "generate" them #22519

Merged
merged 2 commits into from
Feb 7, 2025
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
Prev Previous commit
chore: better rephrasing of the comment
Co-authored-by: Guillaume Martres <smarter@ubuntu.com>
hamzaremmal and smarter committed Feb 7, 2025

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 6029f68adef1d5daa3031e598b3923b8d3d8aa77
Original file line number Diff line number Diff line change
@@ -536,8 +536,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
// We discard the private val representing a case accessor. We only enter the case accessor def.
// We do need to load these symbols to read properly unpickle the annotations on the symbol (see sbt-test/scala2-compat/i19421).
!flags.isAllOf(CaseAccessor | PrivateLocal, butNot = Method) &&
// We don't enter Value Classes' extension methods from pickles, but we do
// generate in the ExtensionMethods phase, at the same time as we do for Scala 3
// Skip entering extension methods: they will be recreated by the ExtensionMethods phase.
// Same trick is used by tasty-query (see
//https://github.com/scalacenter/tasty-query/blob/fdefadcabb2f21d5c4b71f728b81c68f6fddcc0f/tasty-query/shared/src/main/scala/tastyquery/reader/pickles/PickleReader.scala#L261-L273
//)