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
Copy file name to clipboardExpand all lines: blog/_posts/2021-07-21-scala-3.0.2RC1-is-here.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Scala 3.0.2-RC1, in turn, incorporates new language improvements and bug fixes d
13
13
14
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 September).
15
15
16
-
# Improved insertion of semicolons in logical conditions
16
+
##Improved insertion of semicolons in logical conditions
17
17
18
18
Scala 3's indentation based syntax is aimed at making your code more concise and readable. As it gets broader adoption, we consistently improve its specification to eliminate corner cases which might lead to ambiguities or counterintuitive behaviours.
19
19
@@ -32,7 +32,7 @@ if foo(bar)
32
32
then//...
33
33
```
34
34
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.
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.
36
36
37
37
```scala
38
38
if
@@ -49,7 +49,7 @@ if val cond = foo(bar)
49
49
then//...
50
50
```
51
51
52
-
# Towards better null safety in the type system
52
+
##Towards better null safety in the type system
53
53
54
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).
55
55
@@ -59,15 +59,15 @@ After the recently introduced changes with this option enabled the `Null` type b
59
59
deffoo[T<:Matchable](t: T) = t match { casenull=> () }
60
60
```
61
61
62
-
# Method search by type signature
62
+
##Method search by type signature
63
63
64
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).
65
65
66
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).
Structural types may come in handy in many situations, e.g. when one wants to achieve a compromise between safety of static typing and ease of use when dealing with dynamically changing schemas of domain data structures. They have however some limitations. Among others structural typing doesn't normally play well with method overloading because some types of reflective dispatch algorithms (inlcuding JVM reflection) might not be able to choose the overloaded method alternative with the right signature without knowing upfront the exact types of the parameters after erasure. Consider the following snippet.
73
73
@@ -99,7 +99,7 @@ This snippet will compile as the compiler won't perform the precise signature ch
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:
105
105
@@ -109,7 +109,7 @@ Keeping in mind how important metaprogramming has become to Scala developers (es
109
109
- Detect abstract inline method calls after inlining [#12777](https://github.com/lampepfl/dotty/pull/12777)
- Add Scala 3 batch commands for Windows [#13006](https://github.com/lampepfl/dotty/pull/13006)
115
115
- Fix [#12981](https://github.com/lampepfl/dotty/issues/12981): show diagnostics levels (warn \| error) in REPL [#13000](https://github.com/lampepfl/dotty/pull/13000)
@@ -122,7 +122,7 @@ Keeping in mind how important metaprogramming has become to Scala developers (es
122
122
- Preserve hard unions in more situations [#12654](https://github.com/lampepfl/dotty/pull/12654)
123
123
- Better support type-heavy pattern matches [#12549](https://github.com/lampepfl/dotty/pull/12549)
124
124
125
-
# Other notable bug fixes
125
+
##Other notable bug fixes
126
126
127
127
- Fix [#13046](https://github.com/lampepfl/dotty/issues/13046): override is a valid identifier in Java, not a keyword [#13048](https://github.com/lampepfl/dotty/pull/13048)
128
128
- Don't emit Java generic signatures for constructors [#13047](https://github.com/lampepfl/dotty/pull/13047)
@@ -144,7 +144,7 @@ Keeping in mind how important metaprogramming has become to Scala developers (es
144
144
- Always generate a partial function from a lambda [#12670](https://github.com/lampepfl/dotty/pull/12670)
0 commit comments