Skip to content

Commit bd411d9

Browse files
authored
Merge pull request #1324 from Kordyjan/scala-3.1.1
Add Scala 3.1.1 blogpost
2 parents 40f3725 + a484d57 commit bd411d9

File tree

4 files changed

+104
-3
lines changed

4 files changed

+104
-3
lines changed

_downloads/2022-02-01-3.1.1.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Scala 3.1.1
3+
start: 1 February 2022
4+
layout: downloadpage
5+
release_version: 3.1.1
6+
release_date: "February 1, 2022"
7+
permalink: /download/3.1.1.html
8+
license: <a href="https://www.scala-lang.org/license/">Apache License, Version 2.0</a>
9+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
layout: blog-detail
3+
post-type: blog
4+
by: Paweł Marks, VirtusLab
5+
title: Scala 3.1.1 and forward compatibility news
6+
---
7+
8+
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+
10+
## Improvements in Scala 3.1.1
11+
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+
14+
- You can use `using` clauses to introduce subtyping relations between types in the function body.
15+
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+
18+
```scala
19+
def example[A, B](a: A)(using A <:< B) =
20+
val b: B = a
21+
???
22+
```
23+
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+
- 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+
- Dual Scala 2/3 macros can be now declared in non-experimental scopes ([PR #13795](https://github.com/lampepfl/dotty/pull/13795)).
27+
- Scaladoc documentation has an improved UI.
28+
29+
For a comprehensive list of fixes, take a look at [the full changelog on GitHub](https://github.com/lampepfl/dotty/releases/tag/3.1.1).
30+
31+
## 3.1.2-RC1 and forward compatibility improvements
32+
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+
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.
36+
37+
Our current plan to mitigate those difficulties is described in [the contributors discussion](https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298), where you are free to leave your feedback. We already have implemented the first and most important part of the solution and have it ready for public testing. Beginning with Scala 3.1.2-RC1 the compiler is able to generate outputs that can be consumed by its older versions. To enable that, you need to specify the minimal targeted minor language version by using the experimental `-Yscala-release` flag.
38+
39+
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. This way they will be able to benefit from all the bugfixes without restricting their potential audience.
40+
41+
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 has some limitations, especially your library cannot have any dependencies compiled with `-Yscala-release` version higher than 3.0. You also won't be able to use any symbol added to the standard library after 3.0. They are marked in the code and in the documentation by the `@since` annotation that was also added in this version.
42+
43+
One important note is that the `-Yscala-release` flag is experimental and not yet available in any stable release of the compiler. It means the build tools, such as SBT or Mill, are not yet aware of its existence. Of course, you can declare usage of the flag in your build file, and the compiler will respect it. However, there may still be some hiccups, like generated artifacts depending on the incorrect version of the stdlib. We will do our best to help fix those minor issues before the stable release of 3.1.2.
44+
45+
Detailed description of the new flag can be found in [the reference page for the binary comaptibility](https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html).
46+
47+
If you are interested in other changes brought by 3.1.2-RC1, there is, as always, [a changelog on GitHub](https://github.com/lampepfl/dotty/releases/tag/3.1.2-RC1).
48+
49+
## Contributors
50+
51+
Thank you to all the contributors who made this release possible.
52+
53+
According to `git shortlog -sn --no-merges 3.1.0..3.1.1` these are:
54+
55+
```
56+
50 Fengyun Liu
57+
43 Martin Odersky
58+
26 Olivier Blanvillain
59+
24 Kacper Korban
60+
21 Filip Zybała
61+
18 Dale Wijnand
62+
18 Nicolas Stucki
63+
17 Phil
64+
13 Andrzej Ratajczak
65+
10 Guillaume Martres
66+
10 noti0na1
67+
8 Paweł Marks
68+
7 Jamie Thompson
69+
5 soronpo
70+
5 Tom Grigg
71+
3 Yichen Xu
72+
3 Dmitrii Naumenko
73+
3 ghostbuster91
74+
3 Julien Richard-Foy
75+
2 Stéphane Micheloud
76+
2 bjornregnell
77+
2 Vadim Chelyshov
78+
1 ysthakur
79+
1 Daniel Esik
80+
1 EnzeXing
81+
1 Jasper Moeys
82+
1 Katja Goltsova
83+
1 Matthieu Bovel
84+
1 Ondrej Lhotak
85+
1 Oron Port
86+
1 Rikito Taniguchi
87+
1 Seth Tisue
88+
1 Som Snytt
89+
1 Sébastien Doeraene
90+
1 Tomasz Godzik
91+
1 oronpo
92+
```

download/scala3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: downloadpage
33
title: Download Scala 3
44

5-
release_version: 3.1.0
6-
release_date: "October 18, 2021"
5+
release_version: 3.1.1
6+
release_date: "February 1, 2022"
77
license: <a href="https://www.scala-lang.org/license/">Apache License, Version 2.0</a>
88
---

index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ headerButtonUrl: "/what-is-scala/"
99

1010
# Links of the Download / API Docs sections
1111
gettingStarted:
12-
mainTitle: "Scala 3.1.0"
12+
mainTitle: "Scala 3.1.1"
1313
mainUrl: "/download/scala3.html"
1414
subtitle: "Documentation"
1515
subtitleLink: "https://docs.scala-lang.org/scala3"

0 commit comments

Comments
 (0)