You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello from the Scala 3 team! We are back with a new release of the Scala compiler and some exciting news about improvements in forward compatibility.
9
9
10
-
## Improvements is Scala 3.1.1
10
+
## Improvements in Scala 3.1.1
11
11
12
-
Scala 3.1.1 is the patch release focused on bug fixes. Although there are no new additions to the language, you can still spot some noticeable improvements:
12
+
Scala 3.1.1 is a patch release focused on bug fixes. Although there are no new additions to the language, you can still spot some noticeable improvements:
13
13
14
14
- You can use `using` clauses to introduce subtyping relations between types in the function body.
15
15
16
-
Now, the code like below should compile. Any value of type `A` can be used where a value of type `B` is expected as long as a given instance of `A <:< B` is in scope:
16
+
Now, code like the following should compile. Any value of type `A` can be used where a value of type `B` is expected as long as a given instance of `A <:< B` is in scope:
17
17
18
18
```scala
19
19
defexample[A, B](a: A)(usingA<:<B) =
20
20
valb:B= a
21
21
???
22
22
```
23
23
24
-
To know more see [PR #13662](https://github.com/lampepfl/dotty/pull/13662) and [related issue](https://github.com/lampepfl/dotty/issues/12955).
24
+
To learn more see [PR #13662](https://github.com/lampepfl/dotty/pull/13662) and [related issue](https://github.com/lampepfl/dotty/issues/12955).
25
25
- Mirrors can be correctly summoned for hierarchical sum types compiled by Scala 3.0.x. It is now safe to derive a type class for a type dependency that was compiled with a pre-3.1.0 compiler. ([PR #14100](https://github.com/lampepfl/dotty/pull/14100)).
26
26
- Dual Scala 2/3 macros can be now declared in non-experimental scopes ([PR #13795](https://github.com/lampepfl/dotty/pull/13795)).
27
27
- Scaladoc documentation has an improved UI.
@@ -30,7 +30,7 @@ For a comprehensive list of fixes, take a look at [the full changelog on GitHub]
30
30
31
31
## 3.1.2-RC1 and forward compatibility improvements
32
32
33
-
Together with 3.1.1 we have released the first RC version of the next patch release of the compiler. 3.1.2-RC1 contains further fixes, but most importantly it is our first step in improving forward compatibility in Scala.
33
+
Alongside 3.1.1 we have released the first RC version of the next patch release of the compiler. 3.1.2-RC1 contains further fixes, but most importantly it is our first step in improving forward compatibility in Scala.
34
34
35
35
Scala 3 has excellent backward compatibility guarantees between the minor versions. Right now, that means that code compiled with Scala 3.1 can depend on libraries published with 3.0 without any problems. The opposite, hovewer, is not true. Code compiled with 3.0 is not able to read dependencies compiled with 3.1. 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. 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.
0 commit comments