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

Conversation

hamzaremmal
Copy link
Member

Scala 2 generates extension methods for Value Classes before pickling while Scala 3 generates them after.
Now that we are working on compiling the Scala 2 stdlib with dotty (#22480), and therefore generating tasty files for the stdlib, we will have to distinguish between scala 2 that was unpickled and scala 2 code coming from tasty. For that, we currently have a flag, but it is not very useful apart from some very specific details where a workaround exists. This PR, removes one of 2 places where this flag is used. The second place will be removed once we inline the missing symbol in Predef.scala (after #22480) is merged.

@hamzaremmal
Copy link
Member Author

hamzaremmal commented Feb 6, 2025

I've minimized the issue in the community build B to the following:

trait Bar[T]
class Foo[T <: Bar[T]] (private val buffer: Any) extends AnyVal

I'm a bit surprised because it doesn't use any Scala 2 classes and we don't need to have the -Ycompile-scala2-library


EDIT:With -Xprint:all, the compiler doesn't crash

@hamzaremmal
Copy link
Member Author

Blocked by #22548

@hamzaremmal hamzaremmal force-pushed the hr/drop-scala2-tasty-flag branch from 5f1656e to 6029f68 Compare February 7, 2025 16:34
@hamzaremmal hamzaremmal enabled auto-merge February 7, 2025 16:36
@hamzaremmal hamzaremmal merged commit 9066923 into scala:main Feb 7, 2025
27 checks passed
@hamzaremmal hamzaremmal deleted the hr/drop-scala2-tasty-flag branch February 7, 2025 21:14
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.

3 participants