-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Scala3 style imports #4677
Scala3 style imports #4677
Conversation
Looks like it is failing because in #4478 the "-Xsource:3" option was disabled for
🤔 |
Hi @armanbilge, |
Huh, that surprises me. I do have a vague recollection of the issue, I believe it related to some methods that were lacking an explicit type, and under If CI is happy, it's probably okay now (?) but it would be really good to understand why ... |
Yes, it is puzzling quite a bit.. I'm going to convert this Draft to a complete PR and let it stay that way for a while. |
@danicheg @armanbilge does it make sense to proceed with this, wdyt? I personally feel, yes, it does, since it could be yet another step towards Scala3 syntax migration, but I wouldn't like to run ahead of the train anyway. Just to keep things connected: there's another PR (yet draft) in the same direction: #4673 by @xuwei-k, which I'd really love to have merged once it's ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this requires an accepted tactic among the team. Currently, we have a coherent Scala 2 codebase with few provisos. Personally, I'm in favour of keeping that order of things as long as possible. Cats is a Scala 2 project cross-compiling to Scala 3. I don't think braiding the syntaxes of these two languages would make sense. But that's an interesting approach, indeed. What if they invented a strategy to turn Scala 2 syntax into Scala 3 one day?
Hmm.. I don't know. For now it looks like Scala3 is moving in the opposite direction – it keeps gradually deprecating Scala2 style syntaxes from version to version. My point is that if Cats already has |
I think this is the right direction. It seems to me that a lot of the syntax changes from 2->3 are addressing various "warts" (see also #4673). I think it's great that these improvements are being backported to Scala 2. My only hesitation with this PR is trying to understand what was breaking bincompat previously, and why it no longer is, see #4677 (comment). I guess it shouldn't be a blocker, I would just feel better knowing why 😅 |
Could be about different type inference when overriding a method from the superclass |
56c3147
to
79ecda4
Compare
79ecda4
to
6ef3e78
Compare
my view is that users shouldn't care about this and the future is scala 3, so I'm +1. |
Updated: resolved conflicts (here). Where do we stand on this one? Is there anything I can do to clear the concerns? I wonder if Typelevel has org-wide policies on embracing Scala3 syntax and such. |
@johnynek , thank you. |
@armanbilge , I finally got myself to bisect that funky issue with the disappearing binary compatibility issues. When Here is the earliest commit that includes both #4600 and Let me know if it somehow clears your concerns (it doesn't clear mine though, I rather feel confused). |
@armanbilge, I'd like to propose an opinionated solution to the above conundrum: what if we merge this and publish the next time not as a release but rather a pre-release version (somewhat RC1 or even M1)? Then we can let stay it for a while that way to allow other projects to test it for possible binary incompatibilities. Does it look like a good plan? |
@satorg thanks for continuing to work on this! And I really appreciate your diligence raising the question of binary-compatibility in #4677 (comment). My personal opinion is that there is no urgency to merge this PR, as it is an entirely internal-facing change (perhaps I am missing something?). Meanwhile, we know that unfortunately MiMa cannot always catch binary-breaking changes (e.g. see #4702 (comment)). So when I weigh the value of this change against the risk, I think it makes more sense to hold until we understand what is happening.
Your investigation also increases my concerns and confusion. I have not had a chance yet to do my own investigation, based on your results.
This could certainly help us discovery binary-compatibilities, but I don't think it's an effective way to make ourselves confident that no incompatibilities exist. As we know, the ecosystem runs deep, and not all projects will try the milestone / release candidate. In any case, I don't intend to be the sole person to hold this PR up, this is just my opinion 🙂 |
Totally makes sense and I'd like that too, but in order to proceed with that I might use some help on what else I could look into. Do you have any ideas by chance? |
Hi @armanbilge , you're right:
I am not :) Honestly, I don't completely understand how come I ended up with the previous commits range. Perhaps it is because I tried to avoid full rebuilding every time (it runs kinda slow on my 6-year old laptop 🤷 ) This time, however, I took the hard path: I was executing
So, it looks like the upgrade to Scala 2.13.13 fixes the issue. I guess, this phrase from the release notes can be relevant:
Let me know if it makes sense please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@satorg great, thank you so much, that all makes sense now! We're good to move forward now 🚀
I wonder if we should give a shot to
-Xsource:3-cross
instead of just-Xsource:3
🤔
Possibly. To be honest, I'm confused by the naming, but a brief glance at the documentation page suggests that it's more aggressive 🤔 anyway, it's definitely something we can investigate for a new major version of sbt-typelevel.
Thanks everyone who participated in reviewing this PR! I really appreciate your feedback and support! |
Removes
runner.dialectOverride.allowStarWildcardImport = false
from .scalafmt.conf then applies scalafmtAll.UPD.: also re-enables "-Xsource:3" for
algebraCore
andalgebraLaws
.