From 17437a4333dfe3732e5701fb8c8b052ea49514a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Fri, 15 Oct 2021 19:08:16 +0200 Subject: [PATCH 01/23] Draft of 3.1 release blogpost --- .../_posts/2021-10-19-scala-3.1.0-released.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 blog/_posts/2021-10-19-scala-3.1.0-released.md diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md new file mode 100644 index 000000000..b92121718 --- /dev/null +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -0,0 +1,113 @@ +--- +layout: blog-detail +post-type: blog +by: Paweł Marks, VirtusLab +title: Scala 3.1.0 released! +--- +Hello from the Scala 3 team! It has already been six weeks since we have announced the release candidate for the first minor version after the initial release of Scala 3. Now, after two more RCs, we can confidently promote Scala 3.1.0-RC3 to a new stable release of the language. In other words, Scala 3.1.0 is officially out! + +You don't need to worry about having to migrate your projects to the new version. Scala 3 has strong compatibility guarantees, and all code working in 3.0.2 will also work in 3.1. On the other hand, switching to Scala 3.1 allows you to use many improvements and a handful of newly stabilized APIs. + +## What's new in 3.1 + +### New experimental feature: safer exceptions + +A new experimental feature that allows declaring and checking which exceptions can be thrown. It relies on the effects as implicit capabilities pattern. + +You can opt-in using following import. + +```scala +import language.experimental.saferExceptions +``` + +Now it is possible to mark types with exception that cna be thrown during the evalutaion: + +```scala +def f(x: Double): Double canThrow LimitExceeded = + if x < limit then f(x) else throw LimitExceeded()) +``` + +You can read more in [the document proposing this feature](https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/docs/reference/experimental/canthrow.md). + +### Efficient bytecode for matching over strings + +When Scala 3.0 has been compiling pattern matches with `Int` as a scrutinee type, it was emitting bytecode containing very efficient instructions: `lookupswitch` or `tableswitch`. Now in Scala 3.1, similar behavior was implemented for matching over `String` literals. + +```scala +fruit match + case "apple" => 1 + case "orange" => 2 + case "banana" => 3 + case _ => 0 +``` + +will now generate `lookupswitch` over hash codes of `String` literals instead of a chain of conditional expressions. This behavior is consistent with what Java is doing and more performant than the old approach. + +### Support for `-Wconf` and `@nowarn` + +We have added a `-Wconf` compiler flag that allows filtering and configuring compiler warnings (silence them, or turn them into errors). + +We have also integrated [the silencer plugin](https://github.com/ghik/silencer) into the compiler, which allows suppressing warnings locally using the `@nowarn` annotation. + +`-Wconf` and `@nowarn` work largely the same way as in Scala 2, but some filters for selecting warnings are different. For the more details see the output of `-Wconf:help` flag. + +### Simplified Manifest synthesis + +For the sake of compatibility with Scala 2, the Scala 3 compiler now generates given instances for the `Manifest` trait. The new implementation is a slightly simplified approximation of the Scala 2 implementation. It guarantees that any of the expressions: + +- `manifest[A] == manifest[B]` +- `manifest[A].runtimeClass == manifest[B].runtimeClass` +- `optManifest[A] == optManifest[B]` +- `optManifest[A].asInstanceOf[ClassTag[A]].runtimeClass == optManifest[B].asInstanceOf[ClassTag[B]].runtimeClass` + +that was true in Scala 2, will also remain true when compiled with Scala 3. + +### Other changes + +- `Unapply.apply` constructor was added to the reflection API +- Scastie was integrated into Scaladoc to make snippets interactive. +- `@experimental` spec was changed. See more detail in [the design document](https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/docs/reference/other-new-features/experimental-defs.md) +- Now `TastyInspector.{inspectTastyFiles, inspectTastyFilesInJar, inspectAllTastyFiles}` return a boolean value indicating whether the process succeeded +- A `Wildcard` was made a subtype of `Ident` in the reflection API +- `TypedOrTest` was added as a super type of `Typed` in the reflection API + +Beside that scala 3.1.0 introduced multiple small improvements and fixed handful of bugs. You can see [the detailed changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.0) on GitHub. + +## What's next + +During the Scala 3.1.0 stabilization period, which took the last six weeks, we haven't stopped improving the language and fixing the bugs in the compiler. You can already test the results of our work, as they are released as Scala 3.1.1-RC1. [The full changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.1-RC1) is as always available on GitHub. + +You can expect the stable release of Scala 3.1.1 in early December. + +## Contributors + +Thank you to all the contributors who made the release of 3.1.0 possible 🎉 + +According to `git shortlog -sn --no-merges 3.0.2..3.1.0` these are: + +``` + // TODO +``` + +## Library authors: Join our community build + +Scala 3 now has a set of widely-used community libraries that are built against every nightly Scala 3 snapshot. +Join our [community build](https://github.com/lampepfl/dotty/tree/master/community-build) +to make sure that our regression suite includes your library. + +[Scastie]: https://scastie.scala-lang.org/?target=dotty + +[@odersky]: https://github.com/odersky +[@DarkDimius]: https://github.com/DarkDimius +[@smarter]: https://github.com/smarter +[@felixmulder]: https://github.com/felixmulder +[@nicolasstucki]: https://github.com/nicolasstucki +[@liufengyun]: https://github.com/liufengyun +[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain +[@biboudis]: https://github.com/biboudis +[@allanrenucci]: https://github.com/allanrenucci +[@Blaisorblade]: https://github.com/Blaisorblade +[@Duhemm]: https://github.com/Duhemm +[@AleksanderBG]: https://github.com/AleksanderBG +[@milessabin]: https://github.com/milessabin +[@anatoliykmetyuk]: https://github.com/anatoliykmetyuk From a5477d9a50cfc409ce3a2ad68fbc0f86af29619c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Mon, 18 Oct 2021 16:55:41 +0200 Subject: [PATCH 02/23] Apply some suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vinz Co-authored-by: Michał Pałka --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index b92121718..a7af6f398 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -31,7 +31,8 @@ You can read more in [the document proposing this feature](https://github.com/la ### Efficient bytecode for matching over strings -When Scala 3.0 has been compiling pattern matches with `Int` as a scrutinee type, it was emitting bytecode containing very efficient instructions: `lookupswitch` or `tableswitch`. Now in Scala 3.1, similar behavior was implemented for matching over `String` literals. +Scala, since 3.0.0, has been able to optimize pattern matches with `Int` as a scrutinee type by emitting bytecode containing very efficient instructions: `lookupswitch` or `tableswitch`. +Now in Scala 3.1, similar behavior was implemented for matching over `String` literals. ```scala fruit match @@ -41,7 +42,7 @@ fruit match case _ => 0 ``` -will now generate `lookupswitch` over hash codes of `String` literals instead of a chain of conditional expressions. This behavior is consistent with what Java is doing and more performant than the old approach. +will now generate `lookupswitch` over hash codes of `String` literals instead of a chain of conditional expressions. This behavior is consistent with what Java does and more performant than the old approach. ### Support for `-Wconf` and `@nowarn` @@ -75,7 +76,7 @@ Beside that scala 3.1.0 introduced multiple small improvements and fixed handful ## What's next -During the Scala 3.1.0 stabilization period, which took the last six weeks, we haven't stopped improving the language and fixing the bugs in the compiler. You can already test the results of our work, as they are released as Scala 3.1.1-RC1. [The full changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.1-RC1) is as always available on GitHub. +During the Scala 3.1.0 stabilization period, which took the last six weeks, we haven't stopped improving the language and fixing the in the compiler. You can already test the results of our work, using the published release candidates: Scala 3.1.1-RC1. [The full changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.1-RC1) is as always available on GitHub. You can expect the stable release of Scala 3.1.1 in early December. From f021a9179a2cab14f76012cd8e147cbf26edafff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Mon, 18 Oct 2021 17:09:26 +0200 Subject: [PATCH 03/23] Grammar fixes --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index a7af6f398..d287e61f4 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -6,7 +6,7 @@ title: Scala 3.1.0 released! --- Hello from the Scala 3 team! It has already been six weeks since we have announced the release candidate for the first minor version after the initial release of Scala 3. Now, after two more RCs, we can confidently promote Scala 3.1.0-RC3 to a new stable release of the language. In other words, Scala 3.1.0 is officially out! -You don't need to worry about having to migrate your projects to the new version. Scala 3 has strong compatibility guarantees, and all code working in 3.0.2 will also work in 3.1. On the other hand, switching to Scala 3.1 allows you to use many improvements and a handful of newly stabilized APIs. +Thanks to Scala 3 strong compatibility guarantees, all code working in 3.0.2 will also work in 3.1. On the other hand, switching to Scala 3.1 allows you to use many improvements and a handful of newly stabilized APIs. ## What's new in 3.1 @@ -20,11 +20,11 @@ You can opt-in using following import. import language.experimental.saferExceptions ``` -Now it is possible to mark types with exception that cna be thrown during the evalutaion: +Now it is possible to mark types with exception that can be thrown during the evaluation: ```scala def f(x: Double): Double canThrow LimitExceeded = - if x < limit then f(x) else throw LimitExceeded()) + if x < limit then f(x) else throw LimitExceeded() ``` You can read more in [the document proposing this feature](https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/docs/reference/experimental/canthrow.md). @@ -61,7 +61,7 @@ For the sake of compatibility with Scala 2, the Scala 3 compiler now generates g - `optManifest[A] == optManifest[B]` - `optManifest[A].asInstanceOf[ClassTag[A]].runtimeClass == optManifest[B].asInstanceOf[ClassTag[B]].runtimeClass` -that was true in Scala 2, will also remain true when compiled with Scala 3. +that were true in Scala 2, will also remain true when compiled with Scala 3. ### Other changes @@ -70,9 +70,9 @@ that was true in Scala 2, will also remain true when compiled with Scala 3. - `@experimental` spec was changed. See more detail in [the design document](https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/docs/reference/other-new-features/experimental-defs.md) - Now `TastyInspector.{inspectTastyFiles, inspectTastyFilesInJar, inspectAllTastyFiles}` return a boolean value indicating whether the process succeeded - A `Wildcard` was made a subtype of `Ident` in the reflection API -- `TypedOrTest` was added as a super type of `Typed` in the reflection API +- `TypedOrTest` was added as a supertype of `Typed` in the reflection API -Beside that scala 3.1.0 introduced multiple small improvements and fixed handful of bugs. You can see [the detailed changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.0) on GitHub. +Beside that Scala 3.1.0 introduced multiple small improvements and fixed a handful of bugs. You can see [the detailed changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.0) on GitHub. ## What's next From a335e6b47982441a0a7752d8b324ba72110eeb25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Mon, 18 Oct 2021 18:33:10 +0200 Subject: [PATCH 04/23] Some clarifications in the 3.1 blogpost --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index d287e61f4..80db12cbf 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -31,7 +31,7 @@ You can read more in [the document proposing this feature](https://github.com/la ### Efficient bytecode for matching over strings -Scala, since 3.0.0, has been able to optimize pattern matches with `Int` as a scrutinee type by emitting bytecode containing very efficient instructions: `lookupswitch` or `tableswitch`. +Scala, since 3.0.0, has been able to optimize pattern matches with `Int` as a scrutinee type by emitting bytecode containing very efficient instructions: `lookupswitch` or `tableswitch`. Now in Scala 3.1, similar behavior was implemented for matching over `String` literals. ```scala @@ -48,7 +48,7 @@ will now generate `lookupswitch` over hash codes of `String` literals instead of We have added a `-Wconf` compiler flag that allows filtering and configuring compiler warnings (silence them, or turn them into errors). -We have also integrated [the silencer plugin](https://github.com/ghik/silencer) into the compiler, which allows suppressing warnings locally using the `@nowarn` annotation. +We have also brought back `@nowarn` annotation from Scala 2.13, originally inspired by [the silencer plugin](https://github.com/ghik/silencer). It can be used for suppressing warnings directly in the code, in the places where they are expected to occur. `-Wconf` and `@nowarn` work largely the same way as in Scala 2, but some filters for selecting warnings are different. For the more details see the output of `-Wconf:help` flag. @@ -65,12 +65,13 @@ that were true in Scala 2, will also remain true when compiled with Scala 3. ### Other changes -- `Unapply.apply` constructor was added to the reflection API - Scastie was integrated into Scaladoc to make snippets interactive. -- `@experimental` spec was changed. See more detail in [the design document](https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/docs/reference/other-new-features/experimental-defs.md) +- `@experimental` annotation is no longer itself experimental. The users are no longer required to use a nightly build of the compiler to be able to define experimental APIs. See more detail in [the design document](https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/docs/reference/other-new-features/experimental-defs.md) - Now `TastyInspector.{inspectTastyFiles, inspectTastyFilesInJar, inspectAllTastyFiles}` return a boolean value indicating whether the process succeeded - A `Wildcard` was made a subtype of `Ident` in the reflection API - `TypedOrTest` was added as a supertype of `Typed` in the reflection API +- `Unapply.apply` was added to allow contruction of `Unapply` trees from macros +- Scala 3.1 targets Scala.js 1.7.x+. This means that users must upgrade to Scala.js 1.7.0 or later to use Scala 3.1. Beside that Scala 3.1.0 introduced multiple small improvements and fixed a handful of bugs. You can see [the detailed changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.0) on GitHub. From 1b430cfecef0fb8d12df92bd97f81eb2f73e1344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Tue, 19 Oct 2021 12:41:49 +0200 Subject: [PATCH 05/23] Add compatibility notice --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index 80db12cbf..98d971b85 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -6,7 +6,14 @@ title: Scala 3.1.0 released! --- Hello from the Scala 3 team! It has already been six weeks since we have announced the release candidate for the first minor version after the initial release of Scala 3. Now, after two more RCs, we can confidently promote Scala 3.1.0-RC3 to a new stable release of the language. In other words, Scala 3.1.0 is officially out! -Thanks to Scala 3 strong compatibility guarantees, all code working in 3.0.2 will also work in 3.1. On the other hand, switching to Scala 3.1 allows you to use many improvements and a handful of newly stabilized APIs. +## Compatibility notcie + +This is a first *minor* release after the initial release of Scala 3.0. This has following consequences: + +- Scala 3.1 is backward source compatible: any code that was working in 3.0 will also work in 3.1. +- Scala 3.1 is backward binary compatible: you can use dependencies compiled with Scala 3.0 in 3.1 projects. +- Scala 3.1 is _not_ forward binary compatible: you _cannot_ use dependencies compiled with Scala 3.1 in Scala 3.0 projects. +- Updating Scala to 3.1 is not forward compatible change. If you are a library maintainer you should only do that in minor release of your project. ## What's new in 3.1 From 638f70f678bc31412b8de0c1c8b90f01b0a39c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Tue, 19 Oct 2021 13:01:52 +0200 Subject: [PATCH 06/23] Add point about unreductible match types raising error --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 1 + 1 file changed, 1 insertion(+) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index 98d971b85..d6e50e39f 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -78,6 +78,7 @@ that were true in Scala 2, will also remain true when compiled with Scala 3. - A `Wildcard` was made a subtype of `Ident` in the reflection API - `TypedOrTest` was added as a supertype of `Typed` in the reflection API - `Unapply.apply` was added to allow contruction of `Unapply` trees from macros +- Unreductible match types are now raising type error - Scala 3.1 targets Scala.js 1.7.x+. This means that users must upgrade to Scala.js 1.7.0 or later to use Scala 3.1. Beside that Scala 3.1.0 introduced multiple small improvements and fixed a handful of bugs. You can see [the detailed changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.0) on GitHub. From c1ec919a288135dfb5f813a3af90b68cc59ae453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Tue, 19 Oct 2021 15:06:17 +0200 Subject: [PATCH 07/23] Add contributors list --- .../_posts/2021-10-19-scala-3.1.0-released.md | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index d6e50e39f..c8e7ef044 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -96,7 +96,52 @@ Thank you to all the contributors who made the release of 3.1.0 possible 🎉 According to `git shortlog -sn --no-merges 3.0.2..3.1.0` these are: ``` - // TODO + 61 Martin Odersky + 51 tanishiking + 50 Nicolas Stucki + 39 Kacper Korban + 33 Andrzej Ratajczak + 22 Dale Wijnand + 22 Olivier Blanvillain + 21 Lukas Rytz + 17 Filip Zybała + 16 Yichen Xu + 15 Rikito Taniguchi + 14 Sébastien Doeraene + 12 Krzysztof Romanowski + 11 EnzeXing + 9 Guillaume Martres + 9 Jamie Thompson + 8 Tom Grigg + 6 Seth Tisue + 5 Alec Theriault + 4 Michał Pałka + 4 Phil + 3 Fengyun Liu + 3 Paweł Marks + 2 Vadim Chelyshov + 2 Dmitrii Naumenko + 2 Julien Richard-Foy + 2 Kevin Lee + 2 Liu Fengyun + 2 Stéphane Micheloud + 2 Tomasz Godzik + 2 Adrien Piquerez + 2 adampauls + 2 noti0na1 + 1 Kai + 1 Jeremy Smith + 1 Som Snytt + 1 Anselm von Wangenheim + 1 Boris + 1 Arnout Engelen + 1 odersky + 1 Anatolii Kmetiuk + 1 PJ Fanning + 1 Matthieu Bovel + 1 Performant Data + 1 Mario Bucev + 1 Ruslan Shevchenko ``` ## Library authors: Join our community build From 31f308333241600c6ac735e231b7ba5321fa92a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Tue, 19 Oct 2021 15:11:06 +0200 Subject: [PATCH 08/23] Update other files related to the 3.1.0 release --- _downloads/2021-10-18-3.1.0.md | 9 +++++++++ download/scala3.md | 4 ++-- index.md | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 _downloads/2021-10-18-3.1.0.md diff --git a/_downloads/2021-10-18-3.1.0.md b/_downloads/2021-10-18-3.1.0.md new file mode 100644 index 000000000..c61dfc060 --- /dev/null +++ b/_downloads/2021-10-18-3.1.0.md @@ -0,0 +1,9 @@ +--- +title: Scala 3.1.0 +start: 18 October 2021 +layout: downloadpage +release_version: 3.1.0 +release_date: "October 18, 2021" +permalink: /download/3.1.0.html +license: Apache License, Version 2.0 +--- diff --git a/download/scala3.md b/download/scala3.md index f67f7a15d..dd7668308 100644 --- a/download/scala3.md +++ b/download/scala3.md @@ -2,7 +2,7 @@ layout: downloadpage title: Download Scala 3 -release_version: 3.0.2 -release_date: "September 1, 2021" +release_version: 3.1.0 +release_date: "October 18, 2021" license: Apache License, Version 2.0 --- diff --git a/index.md b/index.md index 3df3a38f4..781da47a7 100644 --- a/index.md +++ b/index.md @@ -9,7 +9,7 @@ headerButtonUrl: "/what-is-scala/" # Links of the Download / API Docs sections gettingStarted: - mainTitle: "Scala 3.0.2" + mainTitle: "Scala 3.1.0" mainUrl: "/download/scala3.html" subtitle: "Documentation" subtitleLink: "https://docs.scala-lang.org/scala3" From 30982b1ebdd862a4c5ff4bf2c1554f75c93a6aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 10:59:49 +0200 Subject: [PATCH 09/23] Add a paragraph about Mirrors for hierarchical sum types --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index c8e7ef044..1bf3158c1 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -70,6 +70,20 @@ For the sake of compatibility with Scala 2, the Scala 3 compiler now generates g that were true in Scala 2, will also remain true when compiled with Scala 3. +### Mirrors for Hierarchical Sealed Types + +Consider the following sealed hierarchy: + +```scala +sealed trait Top +case class Middle() extends Top with Bottom +sealed trait Bottom extends Top +``` + +Previously you would not be able to summon an instance of `scala.deriving.Mirror.SumOf` for `Top`, as its child `Bottom` is also sealed. In Scala 3.1 this is now possible, enabling compiletime reflection over nested hierarchies of sealed types. + +The only change necessary for users is that you should now consider that one of the `MirroredElemTypes` for a `Mirror.SumOf could also be a sum type, not just product types. + ### Other changes - Scastie was integrated into Scaladoc to make snippets interactive. From 2509e8a520a2192f1e13a5a85cda0f892203527b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 11:33:33 +0200 Subject: [PATCH 10/23] Update blog/_posts/2021-10-19-scala-3.1.0-released.md Co-authored-by: Dale Wijnand --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index 1bf3158c1..8cc4adb43 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -13,7 +13,7 @@ This is a first *minor* release after the initial release of Scala 3.0. This has - Scala 3.1 is backward source compatible: any code that was working in 3.0 will also work in 3.1. - Scala 3.1 is backward binary compatible: you can use dependencies compiled with Scala 3.0 in 3.1 projects. - Scala 3.1 is _not_ forward binary compatible: you _cannot_ use dependencies compiled with Scala 3.1 in Scala 3.0 projects. -- Updating Scala to 3.1 is not forward compatible change. If you are a library maintainer you should only do that in minor release of your project. +- Updating Scala to 3.1 is not a forward compatible change. If you are a library maintainer and are following SemVer you may want to update in your next minor release. ## What's new in 3.1 From 7ebcf45d0df772281f4a7aecd2aa8fb82fbe9aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 11:33:41 +0200 Subject: [PATCH 11/23] Update blog/_posts/2021-10-19-scala-3.1.0-released.md Co-authored-by: Julien Richard-Foy --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index 8cc4adb43..2c36a87d0 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -6,7 +6,7 @@ title: Scala 3.1.0 released! --- Hello from the Scala 3 team! It has already been six weeks since we have announced the release candidate for the first minor version after the initial release of Scala 3. Now, after two more RCs, we can confidently promote Scala 3.1.0-RC3 to a new stable release of the language. In other words, Scala 3.1.0 is officially out! -## Compatibility notcie +## Compatibility notice This is a first *minor* release after the initial release of Scala 3.0. This has following consequences: From 37b52cc9e2d50417e91e9e4fe68f2d58bc98053b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 13:22:01 +0200 Subject: [PATCH 12/23] Update blog/_posts/2021-10-19-scala-3.1.0-released.md Co-authored-by: Jamie Thompson --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index 2c36a87d0..10356fa6e 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -82,7 +82,7 @@ sealed trait Bottom extends Top Previously you would not be able to summon an instance of `scala.deriving.Mirror.SumOf` for `Top`, as its child `Bottom` is also sealed. In Scala 3.1 this is now possible, enabling compiletime reflection over nested hierarchies of sealed types. -The only change necessary for users is that you should now consider that one of the `MirroredElemTypes` for a `Mirror.SumOf could also be a sum type, not just product types. +The only change necessary for users is that you should now consider that one of the `MirroredElemTypes` for a `Mirror.SumOf` could also be a sum type, not just product types. ### Other changes From 5af72425afa0cc70a5cbd307323f8bb8e7824aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 18:57:49 +0200 Subject: [PATCH 13/23] New Compatibility Notice --- blog/_posts/2021-10-19-scala-3.1.0-released.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-19-scala-3.1.0-released.md index 10356fa6e..2565d8fbd 100644 --- a/blog/_posts/2021-10-19-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-19-scala-3.1.0-released.md @@ -10,11 +10,14 @@ Hello from the Scala 3 team! It has already been six weeks since we have announc This is a first *minor* release after the initial release of Scala 3.0. This has following consequences: -- Scala 3.1 is backward source compatible: any code that was working in 3.0 will also work in 3.1. - Scala 3.1 is backward binary compatible: you can use dependencies compiled with Scala 3.0 in 3.1 projects. - Scala 3.1 is _not_ forward binary compatible: you _cannot_ use dependencies compiled with Scala 3.1 in Scala 3.0 projects. - Updating Scala to 3.1 is not a forward compatible change. If you are a library maintainer and are following SemVer you may want to update in your next minor release. +Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. + +If you are a library maintainer, updating to 3.1.0 will force all of your users to need to update as well. You may consider still publishing your library using 3.0.2 to ensure that users who are reluctant to update a compiler can still use it. On the other hand, we still encourage you to test your library using 3.1.0. We understand that the current state of binary compatibility may be unsatisfactory for library maintainers. We are actively working on improvements in this area in future releases on scala. + ## What's new in 3.1 ### New experimental feature: safer exceptions From 4410b3074769d01e0237f44d02c476b7fb7c0aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 18:58:36 +0200 Subject: [PATCH 14/23] Update the publication date --- ...scala-3.1.0-released.md => 2021-10-21-scala-3.1.0-released.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename blog/_posts/{2021-10-19-scala-3.1.0-released.md => 2021-10-21-scala-3.1.0-released.md} (100%) diff --git a/blog/_posts/2021-10-19-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md similarity index 100% rename from blog/_posts/2021-10-19-scala-3.1.0-released.md rename to blog/_posts/2021-10-21-scala-3.1.0-released.md From 76d68d4d5dae79259c8ef72a652db427402db5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 19:01:40 +0200 Subject: [PATCH 15/23] Two small clarifications --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index 2565d8fbd..9d226113b 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -16,7 +16,7 @@ This is a first *minor* release after the initial release of Scala 3.0. This has Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. -If you are a library maintainer, updating to 3.1.0 will force all of your users to need to update as well. You may consider still publishing your library using 3.0.2 to ensure that users who are reluctant to update a compiler can still use it. On the other hand, we still encourage you to test your library using 3.1.0. We understand that the current state of binary compatibility may be unsatisfactory for library maintainers. We are actively working on improvements in this area in future releases on scala. +If you are a library maintainer, *updating to 3.1.0 will force all of your users to need to update as well*. You may consider still publishing your library using 3.0.2 to ensure that users who are reluctant to update a compiler can still use it. On the other hand, we still encourage you to test your library using 3.1.0. We understand that the current state of binary compatibility may be unsatisfactory for library maintainers. We are actively working on improvements in this area in future releases on scala. ## What's new in 3.1 @@ -83,7 +83,7 @@ case class Middle() extends Top with Bottom sealed trait Bottom extends Top ``` -Previously you would not be able to summon an instance of `scala.deriving.Mirror.SumOf` for `Top`, as its child `Bottom` is also sealed. In Scala 3.1 this is now possible, enabling compiletime reflection over nested hierarchies of sealed types. +Previously you would not be able to summon an instance of `scala.deriving.Mirror.SumOf` for `Top`, as its child `Bottom` is not a case class. In Scala 3.1 this is now possible, enabling compiletime reflection over nested hierarchies of sealed types. The only change necessary for users is that you should now consider that one of the `MirroredElemTypes` for a `Mirror.SumOf` could also be a sum type, not just product types. From e0cdb31f33a0cb7b050a69a6ddfbe4c18d788f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 19:15:22 +0200 Subject: [PATCH 16/23] Add stronger statement of our commitment --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index 9d226113b..c52504476 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -16,7 +16,7 @@ This is a first *minor* release after the initial release of Scala 3.0. This has Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. -If you are a library maintainer, *updating to 3.1.0 will force all of your users to need to update as well*. You may consider still publishing your library using 3.0.2 to ensure that users who are reluctant to update a compiler can still use it. On the other hand, we still encourage you to test your library using 3.1.0. We understand that the current state of binary compatibility may be unsatisfactory for library maintainers. We are actively working on improvements in this area in future releases on scala. +If you are a library maintainer, *updating to 3.1.0 will force all of your users to need to update as well*. You may consider still publishing your library using 3.0.2 to ensure that users who are reluctant to update a compiler can still use it. On the other hand, we still encourage you to test your library using 3.1.0. We understand that the current state of binary compatibility may be unsatisfactory for library maintainers. We are actively working on improvements in this area in future releases of Scala. We are taking the problem of forward-compatibility seriously, and we will provide a technical solution for 3.2.0 ## What's new in 3.1 From f20da7092c54ebd304567fd2eaad898436beb319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 19:38:25 +0200 Subject: [PATCH 17/23] Update blog/_posts/2021-10-21-scala-3.1.0-released.md Co-authored-by: Julien Richard-Foy --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index c52504476..5b50899e8 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -16,7 +16,7 @@ This is a first *minor* release after the initial release of Scala 3.0. This has Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. -If you are a library maintainer, *updating to 3.1.0 will force all of your users to need to update as well*. You may consider still publishing your library using 3.0.2 to ensure that users who are reluctant to update a compiler can still use it. On the other hand, we still encourage you to test your library using 3.1.0. We understand that the current state of binary compatibility may be unsatisfactory for library maintainers. We are actively working on improvements in this area in future releases of Scala. We are taking the problem of forward-compatibility seriously, and we will provide a technical solution for 3.2.0 +If you are a library maintainer, *updating to 3.1.0 will force all of your users to update to 3.1.0 as well*. We understand that the current state of binary compatibility may be unsatisfactory. We are actively working on technical solutions to support forward-compatibility in 3.2.0. In the meantime, we recommend testing your library with Scala 3.1.0 and 3.0.2, but _publishing_ it with 3.0.2. This will allow downstream users to use your library even if they can’t update to Scala 3.1.0. You can find an example of build that follows this recommendation [here](https://github.com/typelevel/scalacheck/pull/847). ## What's new in 3.1 From ba284648b80527a6fac26a2d1c33a63ede539827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Wed, 20 Oct 2021 19:38:45 +0200 Subject: [PATCH 18/23] Update blog/_posts/2021-10-21-scala-3.1.0-released.md Co-authored-by: Julien Richard-Foy --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index 5b50899e8..a4fbbe8a9 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -14,7 +14,7 @@ This is a first *minor* release after the initial release of Scala 3.0. This has - Scala 3.1 is _not_ forward binary compatible: you _cannot_ use dependencies compiled with Scala 3.1 in Scala 3.0 projects. - Updating Scala to 3.1 is not a forward compatible change. If you are a library maintainer and are following SemVer you may want to update in your next minor release. -Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. +Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except in some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. You will still be able to use dependencies compiled with Scala 3.0. If you are a library maintainer, *updating to 3.1.0 will force all of your users to update to 3.1.0 as well*. We understand that the current state of binary compatibility may be unsatisfactory. We are actively working on technical solutions to support forward-compatibility in 3.2.0. In the meantime, we recommend testing your library with Scala 3.1.0 and 3.0.2, but _publishing_ it with 3.0.2. This will allow downstream users to use your library even if they can’t update to Scala 3.1.0. You can find an example of build that follows this recommendation [here](https://github.com/typelevel/scalacheck/pull/847). From ec42953dad8ffbbd8bfb82c93f67cef01d368795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Thu, 21 Oct 2021 14:01:25 +0200 Subject: [PATCH 19/23] Last clarifications --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index a4fbbe8a9..2623e1074 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -12,7 +12,6 @@ This is a first *minor* release after the initial release of Scala 3.0. This has - Scala 3.1 is backward binary compatible: you can use dependencies compiled with Scala 3.0 in 3.1 projects. - Scala 3.1 is _not_ forward binary compatible: you _cannot_ use dependencies compiled with Scala 3.1 in Scala 3.0 projects. -- Updating Scala to 3.1 is not a forward compatible change. If you are a library maintainer and are following SemVer you may want to update in your next minor release. Although we cannot guarantee full source compatibility between minor versions, we have put a lot of effort into assuring that all code that was working in 3.0.2, except in some rare cases, will also work in 3.1.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements. You will still be able to use dependencies compiled with Scala 3.0. @@ -102,7 +101,7 @@ Beside that Scala 3.1.0 introduced multiple small improvements and fixed a handf ## What's next -During the Scala 3.1.0 stabilization period, which took the last six weeks, we haven't stopped improving the language and fixing the in the compiler. You can already test the results of our work, using the published release candidates: Scala 3.1.1-RC1. [The full changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.1-RC1) is as always available on GitHub. +During the Scala 3.1.0 stabilization period, which took the last six weeks, we haven't stopped improving the language and fixing the bugs in the compiler. You can already test the results of our work, using the published release candidate: Scala 3.1.1-RC1. [The full changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.1-RC1) is as always available on GitHub. You can expect the stable release of Scala 3.1.1 in early December. @@ -163,7 +162,7 @@ According to `git shortlog -sn --no-merges 3.0.2..3.1.0` these are: ## Library authors: Join our community build -Scala 3 now has a set of widely-used community libraries that are built against every nightly Scala 3 snapshot. +Scala 3 has a set of widely-used community libraries that are built against every nightly Scala 3 snapshot. Join our [community build](https://github.com/lampepfl/dotty/tree/master/community-build) to make sure that our regression suite includes your library. From 8bc74a5b1a521e1d6960766137fc52412e86c7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Thu, 21 Oct 2021 14:36:14 +0200 Subject: [PATCH 20/23] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michał Pałka --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index 2623e1074..735c5e675 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -29,7 +29,7 @@ You can opt-in using following import. import language.experimental.saferExceptions ``` -Now it is possible to mark types with exception that can be thrown during the evaluation: +Now it is possible to mark types with the type of exception that can be thrown during the evaluation: ```scala def f(x: Double): Double canThrow LimitExceeded = @@ -84,7 +84,7 @@ sealed trait Bottom extends Top Previously you would not be able to summon an instance of `scala.deriving.Mirror.SumOf` for `Top`, as its child `Bottom` is not a case class. In Scala 3.1 this is now possible, enabling compiletime reflection over nested hierarchies of sealed types. -The only change necessary for users is that you should now consider that one of the `MirroredElemTypes` for a `Mirror.SumOf` could also be a sum type, not just product types. +The only change necessary for users is that they should now consider that one of the `MirroredElemTypes` for a `Mirror.SumOf` could also be a sum type, not just product types. ### Other changes @@ -94,7 +94,7 @@ The only change necessary for users is that you should now consider that one of - A `Wildcard` was made a subtype of `Ident` in the reflection API - `TypedOrTest` was added as a supertype of `Typed` in the reflection API - `Unapply.apply` was added to allow contruction of `Unapply` trees from macros -- Unreductible match types are now raising type error +- Unreductible match types now raise type errors - Scala 3.1 targets Scala.js 1.7.x+. This means that users must upgrade to Scala.js 1.7.0 or later to use Scala 3.1. Beside that Scala 3.1.0 introduced multiple small improvements and fixed a handful of bugs. You can see [the detailed changelog](https://github.com/lampepfl/dotty/releases/tag/3.1.0) on GitHub. From c59eb20d54933ea35f3ef069c7c52808a2124b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Thu, 21 Oct 2021 14:36:33 +0200 Subject: [PATCH 21/23] Update blog/_posts/2021-10-21-scala-3.1.0-released.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michał Pałka --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index 735c5e675..faaf745e4 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -23,7 +23,7 @@ If you are a library maintainer, *updating to 3.1.0 will force all of your users A new experimental feature that allows declaring and checking which exceptions can be thrown. It relies on the effects as implicit capabilities pattern. -You can opt-in using following import. +You can opt-in using the following import. ```scala import language.experimental.saferExceptions From 0a7655f6e915e3488564b057c899d61808bc9773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Thu, 21 Oct 2021 14:44:39 +0200 Subject: [PATCH 22/23] Add note about versioning scheme --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index faaf745e4..3e92e8cfc 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -8,7 +8,7 @@ Hello from the Scala 3 team! It has already been six weeks since we have announc ## Compatibility notice -This is a first *minor* release after the initial release of Scala 3.0. This has following consequences: +Scala 3 follows `major.minor.patch` versioning scheme (unlike Scala 2, which uses `epoch.major.minor`). This means that this is the first *minor* release after Scala 3.0.0. This has the following consequences: - Scala 3.1 is backward binary compatible: you can use dependencies compiled with Scala 3.0 in 3.1 projects. - Scala 3.1 is _not_ forward binary compatible: you _cannot_ use dependencies compiled with Scala 3.1 in Scala 3.0 projects. From 48b9ece216cb9d8225c97b9bb394b3edc0db0c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marks?= Date: Thu, 21 Oct 2021 15:38:57 +0200 Subject: [PATCH 23/23] Change `canThrow` to `throws` --- blog/_posts/2021-10-21-scala-3.1.0-released.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blog/_posts/2021-10-21-scala-3.1.0-released.md b/blog/_posts/2021-10-21-scala-3.1.0-released.md index 3e92e8cfc..493ef671d 100644 --- a/blog/_posts/2021-10-21-scala-3.1.0-released.md +++ b/blog/_posts/2021-10-21-scala-3.1.0-released.md @@ -4,6 +4,7 @@ post-type: blog by: Paweł Marks, VirtusLab title: Scala 3.1.0 released! --- + Hello from the Scala 3 team! It has already been six weeks since we have announced the release candidate for the first minor version after the initial release of Scala 3. Now, after two more RCs, we can confidently promote Scala 3.1.0-RC3 to a new stable release of the language. In other words, Scala 3.1.0 is officially out! ## Compatibility notice @@ -32,7 +33,7 @@ import language.experimental.saferExceptions Now it is possible to mark types with the type of exception that can be thrown during the evaluation: ```scala -def f(x: Double): Double canThrow LimitExceeded = +def f(x: Double): Double throws LimitExceeded = if x < limit then f(x) else throw LimitExceeded() ```