We will do our best to help fix those minor issues before the stable release of 3.1.2.ĭetailed description of the new flag can be found in the reference page for the binary compatibility. However, there may still be some hiccups, like generated artifacts depending on the incorrect version of the stdlib. Of course, you can declare usage of the flag in your build file, and the compiler will respect it. It means the build tools, such as SBT or Mill, are not yet aware of its existence. One important note is that the -Yscala-release flag is experimental and not yet available in any stable release of the compiler.
They are marked in the code and in the documentation by the annotation that was also added in this version. You also won’t be able to use any symbol added to the standard library after 3.0. This has some limitations, especially your library cannot have any dependencies compiled with -Yscala-release version higher than 3.0. So, for example, compiling your library using Scala 3.1.2-RC2 with -Yscala-release:3.0 flag, you make it possible for people still using Scala 3.0 to depend on your library. This way they will be able to benefit from all the bugfixes without restricting their potential audience. We expect that in the future authors will use the newest available version of the compiler with -Yscala-release set to the lowest language version that support all features they need. To enable that, you need to specify the minimal targeted minor language version by using the experimental -Yscala-release flag. Beginning with Scala 3.1.2-RC1 the compiler is able to generate outputs that can be consumed by its older versions. We already have implemented the first and most important part of the solution and have it ready for public testing. Our current plan to mitigate those difficulties is described in the contributors discussion, where you are free to leave your feedback. We do not want library authors to be stuck on old versions of the compiler as that would mean that they are locked out of many bugfixes, or we would need to spend enormous effort on backporting every bugfix to all past versioning lines. After the recent release of Scala 3.1.0, we can see that libraries should be really cautious with updating the compiler version, as it forces a bump on every user of that library. Code compiled with 3.0 is not able to read dependencies compiled with 3.1. Right now, that means that code compiled with Scala 3.1 can depend on libraries published with 3.0 without any problems.
Scala 3 has excellent backward compatibility guarantees between the minor versions. 3.1.2-RC1 contains further fixes, but most importantly it is our first step in improving forward compatibility in Scala.
3.1.2-RC1 and forward compatibility improvementsĪlongside 3.1.1 we have released the first RC version of the next patch release of the compiler.
It is now safe to derive a type class for a type dependency that was compiled with a pre-3.1.0 compiler.