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

compiler: account for Scala 2 and 3 differences in generated varargs code #737

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

ahjohannessen
Copy link
Contributor

@ahjohannessen ahjohannessen commented Feb 22, 2024

This adds a bit of redudant overloads. The most important aspect for me now is that mima and tests pass plus a minor release can be shipped. At a later time, one can remove overloads and duplication, do a cleanup with a breaking change and bump major version or similar.

@mkurz mkurz linked an issue Feb 22, 2024 that may be closed by this pull request
@ihostage
Copy link
Member

@ahjohannessen @mkurz I checked this for Gradle and as I expected all is fine. The changes in twirl-compiler works fine for all supported build systems.

@ahjohannessen
Copy link
Contributor Author

@ihostage That is great to hear :)

@mkurz mkurz force-pushed the wip-varargs-syntax branch from 9277011 to c38c2e9 Compare February 27, 2024 10:56
Copy link
Member

@mkurz mkurz left a comment

Choose a reason for hiding this comment

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

Thanks!

I pushed a commit which adds an overloaded function so we stay compatible with previous releases. I know the plugin project is not checked by MiMa because we ususally don't guarantee compatibility for sbt plugins, but this is a cheap thing to do and avoids breaking apps in case someone relies on the method.
I just used a dummy scala version that makes sure Scala 2 code gets generated by default, just like before.

I will cut a new release after that.

@mkurz
Copy link
Member

mkurz commented Feb 27, 2024

@Mergifyio backport 1.6.x

Copy link
Contributor

mergify bot commented Feb 27, 2024

backport 1.6.x

✅ Backports have been created

@ahjohannessen
Copy link
Contributor Author

@mkurz Super :) Next thing could perhaps be to introduce something like:

trait TwirlCompiler {
   def compile(…)
   // perhaps not necessary
   def compileVirtual(…)
}

and do some cleanup with compile options.

@mergify mergify bot merged commit 5fbb1ec into playframework:main Feb 27, 2024
17 checks passed
@mkurz
Copy link
Member

mkurz commented Feb 27, 2024

@ahjohannessen Pull requests always welcome 😉

mergify bot added a commit that referenced this pull request Feb 27, 2024
[1.6.x] compiler: account for Scala 2 and 3 differences in generated varargs code (backport #737) by @ahjohannessen
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.

Scala 3.4.0 complains about x: _* syntax
3 participants