We’ve been trying out 2.13.0-M4 for twitter util, and we have some feedback for scala implementors.
We have historically supported more than one scala version, which is useful for users who are trying to migrate from one version to another, so that they don’t have to both change their library version AND upgrade scala at the same time. However, scala 2.13.x seems to make it really hard to do this. Here are some of the issues we’ve run into when trying to migrate our first module:
- CanBuildFrom removed without a replacement is an issue for compatible source code between 2.11 and 2.13 (where type inference is enough)
- CanBuildFrom removed without a replacement is an issue for compatible source code between 2.12 and 2.13 (where type inference is not enough) e.g. Future.collect
- It’s risky to replace breakOut with views in 2.11 or 2.12 because we have low confidence in the correctness of views pre-2.13.
- ArrayBuffer no longer implements Seq, and no longer provides a
result
method. Nor does mutable.Buffer. We can call toSeq in every case, but we would rather not entail the extra copy, since this is sometimes on the hot path. - Very clunky to convert a java.util.List to a Seq from java.
JavaConverters.asScalaBuffer(list).iterator().toSeq())
Our understanding is that folks are writing scalafix tools to simplify migrating from 2.12 to 2.13, which is great! However, it would be even better if there was a happy medium where we didn’t need to maintain two versions of our source code. Is there any chance you can give us the tools we need to maintain source compatibility between 2.12 and 2.13?