Skip to content

Commit 914e919

Browse files
committed
Address Seth's comments
1 parent 7e03235 commit 914e919

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

docs/blog/_posts/2019-12-20-21th-dotty-milestone-release.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ date: 2019-12-21
88

99
Greetings and we wish you Merry Christmas 🎄!
1010

11-
We are excited to announce 0.21.0-RC1 of Scala 3. In this version we add support
12-
for non-nullable reference types and a flow-sensitive analysis that work
13-
complementary. We present new syntax for given extensions, matches and pattern
14-
matching over quotes. We are also happy to announce that SemanticDB generation
11+
We are excited to announce 0.21.0-RC1 of Dotty. In this version we add support
12+
for non-nullable reference types, supported by flow-sensitive analysis. We
13+
present new syntax for given extensions, matches and pattern matching over
14+
quotes. We are also happy to announce that SemanticDB generation
1515
is now supported within the compiler, this will eventually enable Metals to support Dotty!
1616

1717
# Feature Complete!
@@ -29,7 +29,7 @@ This means that with this release we stop adding new features and we focus on:
2929
- documentation improvements 📕
3030
- education 👨‍🏫
3131

32-
Being feature complete does not mean that every detail of Scala-3 is cast in
32+
Being feature complete does not mean that every detail of Scala 3 is cast in
3333
stone yet. Some details can still change, or be enabled conditionally, or even
3434
be dropped entirely. That will depend on the additional experience we gain over
3535
the next months, in particular the feedback we receive from the community and
@@ -41,7 +41,7 @@ For an overview of the feature envelope that Scala 3 carries you can read our
4141
For a more detailed discussion on the transition to Scala 3 you can read the
4242
[Scala 2 roadmap update: The road to Scala 3](https://www.scala-lang.org/2019/12/18/road-to-scala-3.html).
4343

44-
### Community-build
44+
### Community build
4545

4646
Being feature complete doesn't mean that development slows down. On the contrary!
4747
It means that we can now put the Scala 3 compiler under heavy load, getting it
@@ -62,7 +62,7 @@ from the root of the dotty repo.
6262
Firstly thank you for all the hard work in issue reporting! Being feature complete means that our
6363
issue tracker will now be more important than ever. We encourage you to stress
6464
the compiler and report self contained test-cases! Bug minimization is hard and
65-
a form of art! Help us unearth those nasty bugs! ✊
65+
a art form! Help us unearth those nasty bugs! ✊
6666

6767
Last but not least we restate the mission of Scala 3. Scala has pioneered the
6868
fusion of object-oriented and functional programming in a typed setting and Scala 3
@@ -129,14 +129,42 @@ val s2: String|Null = ???
129129
if (s != null && s2 != null) // s: String and s2: String
130130
```
131131

132-
but also in a short-circuting manner:
132+
but also in a short-circuiting manner:
133133

134134
```scala
135135
val s: String|Null = ???
136136

137137
if (s != null && s.length > 0) // s: String in `s.length > 0`
138138
```
139139

140+
To support Java Interop under explicit nulls we provide an alias for `Null`
141+
called `UncheckedNull`. The compiler can load Java classes in two ways: from
142+
source or from bytecode. In either case, when a Java class is loaded, we "patch"
143+
the type of its members to reflect that Java types remain implicitly nullable.
144+
145+
An additional value of `UncheckedNull` (on the Scala side) is that we
146+
effectively support method chaining on Java-returned values. e.g.,
147+
148+
```scala
149+
val s2: String = someJavaMethod().trim().substring(2).toLowerCase()
150+
```
151+
152+
as opposed to:
153+
154+
```scala
155+
val ret = someJavaMethod()
156+
val s2 = if (ret != null) {
157+
val tmp = ret.trim()
158+
if (tmp != null) {
159+
val tmp2 = tmp.substring(2)
160+
if (tmp2 != null) {
161+
tmp2.toLowerCase()
162+
}
163+
}
164+
}
165+
// Additionally, we need to handle the `else` branches.
166+
```
167+
140168
For more info refer to the docs on [Explicit Nulls](https://dotty.epfl.ch/docs/reference/other-new-features/explicit-nulls.html).
141169

142170
## New syntax for given instances defining extension methods
@@ -178,7 +206,7 @@ Using present given syntax, it can seem awkward to define parameterised instance
178206
```scala
179207
given listOrd[T](given Ord[T]): Ord[List[T]] ...
180208
```
181-
it's particululary unfortunate for anonymous given instances:
209+
it's particularly unfortunate for anonymous given instances:
182210
```scala
183211
given [T](given Ord[T]): Ord[List[T]] ...
184212
```
@@ -224,7 +252,7 @@ After a period of experimentation, either the new or old way will remain.
224252
## New match syntax
225253

226254
We introduce an improved treatment of `match`. We reintroduce `match` as an
227-
alphanumeric, left-associative, infix operator that can support chain matches:
255+
alphanumeric, left-associative, infix operator that can support chained matches:
228256

229257
```scala
230258
xs match {
@@ -245,9 +273,9 @@ xs.match {
245273
}
246274
```
247275

248-
You can read more on our docs [Match Expressions](https://dotty.epfl.ch/docs/reference/changed-features/match-syntax.html) and on the interesting discussions on [contributors](https://contributors.scala-lang.org/t/pre-sip-demote-match-keyword-to-a-method/2137/2).
276+
You can read more in our docs [Match Expressions](https://dotty.epfl.ch/docs/reference/changed-features/match-syntax.html) and on the interesting discussions in [contributors](https://contributors.scala-lang.org/t/pre-sip-demote-match-keyword-to-a-method/2137/2).
249277

250-
## New quoted pattern matching
278+
## Metaprogramming: New quoted pattern matching
251279

252280
We introduce a high-level API to deconstruct or extract values out of `Expr`
253281
using pattern matching. It consists of high-level extractors for getting static

0 commit comments

Comments
 (0)