Skip to content

Commit bdbbbbe

Browse files
committed
Add blogpost for releases 3.0.1 and 3.0.2-RC1 - reworks
1 parent 03903b8 commit bdbbbbe

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

blog/_posts/2021-07-19-scala-3.0.2RC1-is-here.md renamed to blog/_posts/2021-07-21-scala-3.0.2RC1-is-here.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ title: Scala 3.0.1 and 3.0.2-RC1 are here!
66
---
77

88
Greetings from the Scala 3 team! We are glad to announce that Scala 3.0.1 and 3.0.2-RC1 are now officially out.
9-
As no critical bugs have been found in the previously released Scala 3.0.1-RC2, it has been promoted to 3.0.1, which is the first stable release after 3.0.0. Scala 3.0.2-RC1, in turn, incorporates new language improvements and bug fixes.
9+
10+
As no critical bugs have been found in the previously released Scala 3.0.1-RC2, it has been promoted to 3.0.1. It is the first stable release after 3.0.0 and it incorporates the changes described in detail in the articles for its pre-releases: [3.0.1-RC1](https://dotty.epfl.ch/blog/2021/06/07/scala3.0.1-rc1-release.html) and [3.0.1-RC2](https://dotty.epfl.ch/blog/2021/06/25/scala301-rc2.html). The unified changelog can be found [here](https://github.com/lampepfl/dotty/releases/tag/3.0.1).
11+
12+
Scala 3.0.2-RC1, in turn, incorporates new language improvements and bug fixes described below.
13+
14+
You can expect the release of stable 3.0.2 and a release candidate for a the next version in 6 weeks from now (1st August).
1015

1116
# Improved insertion of semicolons in logical conditions
1217

@@ -27,7 +32,7 @@ if foo(bar)
2732
then //...
2833
```
2934

30-
If yor intention is to have a block of code evaluating into a sigle condition you should add a new line and indentation directly after `if` , e.g.
35+
If your intention is to have a block of code evaluating into a single condition you should add a new line and indentation directly after `if` , e.g.
3136

3237
```scala
3338
if
@@ -46,7 +51,7 @@ then //...
4651

4752
# Towards better null safety in the type system
4853

49-
The compiler option `-Yexplicit-nulls` modifies Scala's standard type hierarchy to allow easier tracing of nullable values by performing strict checks directly on the level of the type system rather than just relying of conventions (e.g. this prevents you from writing code like `val foo: Option[String] = Some(null)`, which would be otherwise valid Scala although very likely to cause a `NullPointerException` at some further point).
54+
The compiler option `-Yexplicit-nulls` modifies Scala's standard type hierarchy to allow easier tracing of nullable values by performing strict checks directly on the level of the type system rather than just relying on conventions (e.g. this prevents you from writing code like `val foo: Option[String] = Some(null)`, which would be otherwise valid Scala although very likely to cause a `NullPointerException` at some further point).
5055

5156
After the recently introduced changes with this option enabled the `Null` type becomes a subtype of `Matchable` instead of inheriting directly from `Any`, making the code below compile (this used to compile before only without strict nullability checking).
5257

@@ -56,9 +61,9 @@ def foo[T <: Matchable](t: T) = t match { case null => () }
5661

5762
# Method search by type signature
5863

59-
You can now browse the documentation of Scala's API not only by names of methods but also by their type in a Hoogle-like manner thanks to integration with [Inkuire](https://github.com/VirtusLab/Inkuire) brought up by [#12375](https://github.com/lampepfl/dotty/pull/12375).
64+
You can now browse the documentation of Scala's API not only by names of methods but also by their type in a [Hoogle](https://hoogle.haskell.org)-like manner (but with Scala syntax) thanks to integration with [Inkuire](https://github.com/VirtusLab/Inkuire) brought up by [#12375](https://github.com/lampepfl/dotty/pull/12375).
6065

61-
To find a method with a specified signature simply write in scaladoc's searchbar the type you would expect it to have after eta-expansion (as if this was a function rather than a method).
66+
To find methods with the desired signature simply write in scaladoc's searchbar the type you would expect them to have after eta-expansion (as if they were functions rather than methods).
6267

6368
![image url "image Title"](https://user-images.githubusercontent.com/39772805/117478350-53f12a80-af5f-11eb-82ab-930ba565dacb.gif)
6469

@@ -72,7 +77,7 @@ val a = Sink[String]()
7277
val b: { def put(x: String): Unit } = a
7378
```
7479

75-
This code won't compile. This is because when `Sink[String]` gets erased to `Sink[Object]` (as it's seen from from JVM's perspective) the method's signature becomes `put(x: Object): Unit` while for the structural type it remains unchanged as `put(x: String): Unit` and they wouldn't match in runtime therefore `Sink[String]` cannot be treated as a subtype of `{ def put(x: String): Unit }`.
80+
This code won't compile. This is because when `Sink[String]` gets erased to `Sink[Object]` (as it's seen from JVM's perspective) the method's signature becomes `put(x: Object): Unit` while for the structural type it remains unchanged as `put(x: String): Unit` and they wouldn't match in runtime therefore `Sink[String]` cannot be treated as a subtype of `{ def put(x: String): Unit }`.
7681

7782
We might however try to write a better method dispatch algorithm ourselves instead of relying on the JVM's default one to make this work. To assure the compiler that we know what we're doing we'll need to use the new `Selectable.WithoutPreciseParameterTypes` marker trait. Currently it's an experimental feature (introduced by [#12268](https://github.com/lampepfl/dotty/pull/12268)) so you'll be able to use it only with a snapshot or nightly version of the compiler and you'll need to annotate all subtypes of this trait with `@experimental`.
7883

@@ -96,7 +101,7 @@ This snippet will compile as the compiler won't perform the precise signature ch
96101

97102
# Metaprogramming
98103

99-
Keeping in mind how important metaprogramming has become to Scala developers (especially creators of libraries) we continue to make it more reliable by fixing reported bugs and more powerful by repealing formerly introduced limitations. If you're curious how it was done investigate into the PRs below:
104+
Keeping in mind how important metaprogramming has become to Scala developers (especially creators of libraries) we continue to make it more reliable by fixing reported bugs and more powerful by repealing formerly introduced limitations. If you're curious how it was done look at the PRs below:
100105

101106
- Map opaque types in arguments of inlined calls to proxies [#12922](https://github.com/lampepfl/dotty/pull/12922)
102107
- Don't forget side effects in prefixes of inlined function calls [#12842](https://github.com/lampepfl/dotty/pull/12842)

0 commit comments

Comments
 (0)