-
Notifications
You must be signed in to change notification settings - Fork 223
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
2.13.4+ requires explicit guidance around irrefutable unapply methods #2501
base: main
Are you sure you want to change the base?
2.13.4+ requires explicit guidance around irrefutable unapply methods #2501
Conversation
Turns out I'm incorrect, MiMa reports incompatibility. Happy to discuss here, or in the original issue on scala/scala |
Thanks for raising this PR! This should be mostly safe, but I would like to double check it. Will take a look next week. |
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.
Thanks for the contribution again! I think we should be safe to include the changes, the only thing that is needed is to add:
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.meta.Lit.unapply")
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.meta.Lit.unapply")
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.meta.Name.unapply")
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.meta.Name.unapply")
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.meta.tokens.Tokens.unapplySeq")
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.meta.tokens.Tokens.unapplySeq")
to https://github.com/scalameta/scalameta/blob/main/project/Mima.scala#L30
52487a6
to
80e5882
Compare
So, I added those lines, though I realized that I actually ran into this issue in my own project where the return type change actually caused ABI linking errors for me, but I didn't spend that much time to understand it due to scheduling concerns, I just bumped versions to overcome the incompatibility |
I don't see the lines added in this PR, did you commit the changes? What kind of errors did you encounter with linking? |
I reverted that commit to avoid it getting merged while I still had concerns about it. I'll do some more testing and get back to you with explicit errors, or if it happened to be a different issue I was running into, we can proceed |
OK. So, given the following program in import scala.meta._
object App extends App {
val Name(x) = Term.Name("hello")
println(x)
} I ran
That concludes setup. Now, for the test:
This matches what I was seeing in my own projects. If the goal is ABI compatibility, I do not believe this is a change that should be suppressed. That being said, if I misunderstood the intent of |
I was thinking mostly about source compatibility here, but it might be good to postpone this change until we decide to break binary compatibility to avoid issues for the users. We could follow up with an issue and group those breaking binary compatibility into one milestone maybe? |
@tgodzik Circling back, I realize I neglected to create an issue, as you indicated should be done, nor did I break this PR into components. That's on me, and something I'd like to rectify. Given that, and the fact that time has passed, where do we stand on moving forward? What should I do to advance this? |
We are doing some other binary incompatible changes at this time, but until we decide on it I will maybe add a label and wait until we do decide that. |
Context for this PR: scala/bug#12232 (comment)
This represents the majority of
match may not be exhaustive
warnings in my codebase.Given this trivial program on 2.13.6:
we get:
The mechanical change is to identify places where
unapply
trivially returns aSome
instead of anOption
and constrain the result type.