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

Consider source code as Scala 2 under -Ycompile-scala2-library #22520

Merged
merged 4 commits into from
Feb 12, 2025

Conversation

hamzaremmal
Copy link
Member

When compiling under -Ycompile-scala2-library, we should consider the source code as Scala 2. This change will allow using Scala 2's erasure instead of Scala 3's.

Related to #22480

@hamzaremmal
Copy link
Member Author

Note that I haven't enabled scala2-library-tasty tests because we don't set the Scala2Tasty flag. We can rebase this PR and test them when #22519 is merged.

@hamzaremmal
Copy link
Member Author

hamzaremmal commented Feb 4, 2025

CI is failing because of the string interpolators, I forgot that I changed it in 8cb6b70, we should probably use Scala 3's compiletime package instead of Scala 2's macros.

sjrd
sjrd previously approved these changes Feb 6, 2025
@hamzaremmal hamzaremmal force-pushed the hr/scala2-missing-flag branch from 885403e to aa9074f Compare February 6, 2025 13:14
@hamzaremmal
Copy link
Member Author

I've rebased it on top of #22536 because it failed to find the definitions of extension methods for hashCode and equals when I tried to compile scala2-library-bootstrapped.

@hamzaremmal hamzaremmal force-pushed the hr/scala2-missing-flag branch from aa9074f to 92c9a20 Compare February 7, 2025 21:17
@hamzaremmal hamzaremmal force-pushed the hr/scala2-missing-flag branch from 92c9a20 to 78c7473 Compare February 7, 2025 21:31
@hamzaremmal hamzaremmal enabled auto-merge February 7, 2025 21:33
@hamzaremmal hamzaremmal disabled auto-merge February 7, 2025 22:00
@hamzaremmal hamzaremmal requested a review from sjrd February 10, 2025 22:48
@hamzaremmal hamzaremmal dismissed sjrd’s stale review February 10, 2025 22:51

I've had to change the set of flags that are considered 'effectively open'

@hamzaremmal
Copy link
Member Author

@WojciechMazur has run the open community build against this PR and no compile-time regression was found.

@hamzaremmal hamzaremmal force-pushed the hr/scala2-missing-flag branch from dce5251 to 19c42ee Compare February 12, 2025 12:55
@hamzaremmal hamzaremmal requested a review from sjrd February 12, 2025 13:01
@hamzaremmal hamzaremmal merged commit e88bf19 into scala:main Feb 12, 2025
30 checks passed
@hamzaremmal hamzaremmal deleted the hr/scala2-missing-flag branch February 12, 2025 15:00
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.

4 participants