-
Notifications
You must be signed in to change notification settings - Fork 21
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.9] productIterator
change to case classes breaks bincompat if the class is also a value class
#12650
Comments
I think it is not safe. Reported at lightbend-labs/mima#723 |
Oh thanks! I'll close this one as it is clearly a duplicate :) |
I'll probably need a ticket over here... |
Ah sure, sorry, reopening then ;) |
where
|
The PR in question is scala/scala#10002 . In addition figuring out how to address the issue itself, we should also give a little thought to whether our overall testing regimen could have or should have caught this. (As Som noted on the MiMa ticket, apparently the Scala standard library doesn't have any case classes which are also value classes — if it did, this issue would have shown up.) |
productIterator
change to value classes breaks bincompat
For convenience, copying my comment A case class extending public static java.lang.String productElementName$extension(java.lang.String, int);
public static scala.collection.Iterator<java.lang.Object> productIterator$extension(java.lang.String);
public static java.lang.Object productElement$extension(java.lang.String, int);
public static int productArity$extension(java.lang.String);
public static java.lang.String productPrefix$extension(java.lang.String);
public scala.collection.Iterator<java.lang.String> productElementNames();
public java.lang.String productPrefix();
public int productArity();
public java.lang.Object productElement(int);
public scala.collection.Iterator<java.lang.Object> productIterator();
public java.lang.String productElementName(int); where Now
|
productIterator
change to value classes breaks bincompatproductIterator
change to case classes breaks bincompat if the class is also a value class
Worth noting that we had considered binary compatibility in the PR for case classes, but value classes did not appear on the radar. Sometimes a bytecode diff is performed to witness any changes in output; it would be a bit much to attempt that on CB scala; but one could imagine a modest set of classes in test to validate diffs in bytecode (not only for compatibility). |
To confirm, the SIP specifically excludes inherited members. https://docs.scala-lang.org/sips/value-classes.html It is cold comfort that Scala 3 does not generate |
If this is getting fixed, how long until Scala 2.13.10? |
I think we should do 2.13.10 very soon to avoid (too many) releases built with 2.13.9 to make their way into the wild. Should we keep this ticket open to make it easier to find? |
Can we trust MiMa to catch all instances of this? Or should we avoid releasing projects on 2.13.9 altogether? |
If you're using MiMa you should be safe - modulo unknowns, of course... |
There's now a thread to discuss release contents and timing: https://contributors.scala-lang.org/t/scala-2-13-10-release-planning/5943 |
Closing now since we'll be publishing 2.13.10 shortly, and since we've done a bunch of publicity about the regression in various venues (updated GitHub release notes, Discourse, Twitter, etc) |
MiMA reports the following error when trying to update to 2.13.9, for value classes:
this is for a value case class:
is this something that can be safely ignored?
The text was updated successfully, but these errors were encountered: