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

RFC: use _ instead of * for kind-projector #560

Open
armanbilge opened this issue Jun 23, 2023 · 4 comments
Open

RFC: use _ instead of * for kind-projector #560

armanbilge opened this issue Jun 23, 2023 · 4 comments

Comments

@armanbilge
Copy link
Member

Scala 3 uses _ for kind projector and ? for existential wildcards, but supports the old */_ for compatibility with Scala 2.

I just discovered that Scala 2.12 and 2.13 can also be configured to use the new syntax.
https://github.com/typelevel/kind-projector#inline-underscore-syntax

One of the goals of sbt-typelevel v0.5.0 is to configure scalac so that it behaves more like "true" Scala 3. So I feel very tempted to make this change. We're already using the new syntax in Scala 3-only builds which has been a source of confusion when removing Scala 2 from the cross versions.

However this is a somewhat drastic change already into the RC cycle and will require a lot of existing code to be rewritten, I'm not sure how well find-replace could work.

Thoughts?

@ChristopherDavenport
Copy link
Member

This would be a very large source breaking change to anyone using this. As someone with a lot of code that has the new components in place this concerns me, as it means a lot of manual rewrites throughout the entire corpus to then update this plugin.

Its not unreasonable, but its also going to force all of your users to pay a tax, and it may be a lot.

@djspiewak
Copy link
Member

I feel like it's better to do this in a couple of stages. Start by adding it default-off behind a setting, then in the next release add a warning if it's off, then the release after that swap the default to on, then after that add @deprecated to the setting.

@rossabaker
Copy link
Member

Can I pay my taxes with a Scalafix, or just hard labor? Do editors widely support this non-default syntax for what's already a foreign compiler plugin?

@armanbilge
Copy link
Member Author

Thanks everyone. Daniel is right, this should definitely be a toggleable setting, starting with opt-in. We can revisit in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants