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: docs/blog/_posts/2021-02-17-scala3-rc1.md
+31-15Lines changed: 31 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,14 @@ date: 2021-02-17
8
8
9
9
Greetings from the Scala 3 team! We are delighted to announce the first release candidate of the stable version of Scala 3 – Scala 3.0.0-RC1.
10
10
11
-
This release brings some last-minute polishings, clean-ups and changes before the big release. There were a few language changes to improve the user experience, as well as the polishings of the metaprogramming framework. We have also worked on the issues that had to be fixed before the stable release.
11
+
This release brings some last-minute polishings, clean-ups and changes before the big release. There were a few language changes to improve the user experience,
12
+
as well as the polishings of the metaprogramming framework. We have also worked on the issues that had to be fixed before the stable release.
12
13
13
14
Overall, more than [400 PRs](https://github.com/lampepfl/dotty/pulls?q=is%3Apr+is%3Aclosed+closed%3A%3E2020-12-02+sort%3Acomments-desc) were merged after the M3 release and until today! Read more below!
14
15
15
16
<!--more-->
16
-
# Allow secondary type parameter list in extension methods
17
+
## Allow secondary type parameter list in extension methods
18
+
17
19
Type parameters on extensions can now be combined with type parameters on the methods themselves. E.g.:
18
20
19
21
```scala
@@ -27,6 +29,7 @@ Type arguments matching method type parameters are passed as usual:
27
29
```scala
28
30
List("a", "bb", "ccc").sumBy[Int](_.length)
29
31
```
32
+
30
33
By contrast, type arguments matching type parameters following `extension` can be passed
31
34
only if the method is referenced as a non-extension method:
For discussion, see [PR #10940](https://github.com/lampepfl/dotty/pull/10940). For more information about the extension methods, see [documentation](https://dotty.epfl.ch/docs/reference/contextual/extension-methods.html).
44
47
45
-
# New `import` syntax
48
+
## New `import` syntax
49
+
46
50
The following are the changes to the `import` syntax made in this release.
47
51
48
52
Wildcard import `_` is replaced by `*`. The motivation is that the majority of other languages use `*`. For example:
@@ -60,10 +64,12 @@ import NumPy as np
60
64
61
65
For the details and discussion, see [PR #11244](https://github.com/lampepfl/dotty/pull/11244). Read more about this change in the [documentation](https://dotty.epfl.ch/docs/reference/changed-features/imports.html).
62
66
63
-
# Use `*` for vararg splices.
67
+
## Use `*` for vararg splices
68
+
64
69
[PR #11240](https://github.com/lampepfl/dotty/pull/11240) changed the syntax of vararg splices in patterns and function arguments. The new syntax uses a postfix `*`, instead of `: _*`, analogously to how a vararg parameter is declared.
65
70
66
-
# Use `uninitialized` for wildcard initializers
71
+
## Use `uninitialized` for wildcard initializers
72
+
67
73
An obscure use of `_` occurs in var definitions:
68
74
69
75
```scala
@@ -84,7 +90,8 @@ This way expresses the intent of the idiom in a more verbose and easy to read wa
84
90
85
91
For discussion, see [PR #11231](https://github.com/lampepfl/dotty/pull/11231), and the [documentation](https://dotty.epfl.ch/docs/reference/dropped-features/wildcard-init.html) is available on our website.
86
92
87
-
# Eta-expand companion object if functions are expected
93
+
## Eta-expand companion object if functions are expected
94
+
88
95
Starting from RC1, we no longer generate a function parent for companions of case classes. Which means, for example, that given `case class Foo(x: Int)`, you won't be able to use `Foo` in a position where a function is expected:
89
96
90
97
```scala
@@ -104,18 +111,26 @@ Results in:
104
111
105
112
As the warning suggests, now you should write `Foo.apply` instead of `Foo`. See [Issue #6190](https://github.com/lampepfl/dotty/issues/6190) and [PR #7207](https://github.com/lampepfl/dotty/pull/7207) for discussion.
106
113
107
-
# Settling on `scaladoc` as the documentation tool
108
-
We have settled on using the well-known `scaladoc` as a name for the documentation tool for Scala 3 (known previously as `scala3doc`).. The obsolete `dotty-doc` (or `scala3-doc`) is removed in RC1. We have also removed all the Kotlin dependencies (Dokka, etc.) from scaladoc. For details, see [PR #11349](https://github.com/lampepfl/dotty/pull/11349). To read more about `scaladoc`, see [documentation](https://dotty.epfl.ch/docs/usage/scaladoc/index.html)
114
+
## Settling on `scaladoc` as the documentation tool
115
+
116
+
We have settled on using the well-known `scaladoc` as a name for the documentation tool for Scala 3 (known previously as `scala3doc`).
117
+
The obsolete `dotty-doc` (or `scala3-doc`) is removed in RC1. We have also removed all the Kotlin dependencies (Dokka, etc.) from scaladoc.
118
+
For details, see [PR #11349](https://github.com/lampepfl/dotty/pull/11349). To read more about `scaladoc`, see [documentation](https://dotty.epfl.ch/docs/usage/scaladoc/index.html)
119
+
120
+
## Use `future` and `future-migration` to specify language versions after 3.0 in `-source`
109
121
110
-
# Use `future` and `future-migration` to specify language versions after 3.0 in `-source`
111
122
[PR #11355](https://github.com/lampepfl/dotty/pull/11355) changes the `-source` specifier for the Scala version(s) after 3.0 from `3.1` to `future`. I.e. it is now
112
-
`-source future` and `-source future-migration` instead of `-source 3.1` and `-source 3.1-migration`. Language imports are changed analogously. The reason for the change is that we want to keep the possibility open to ship a `3.1` version that does not yet contain all the changes enabled under `-source future`.
123
+
`-source future` and `-source future-migration` instead of `-source 3.1` and `-source 3.1-migration`. Language imports are changed analogously. The reason for the change is that
124
+
we want to keep the possibility open to ship a `3.1` version that does not yet contain all the changes enabled under `-source future`.
125
+
126
+
## Other language changes
113
127
114
-
# Other language changes
115
128
- Warn when matching against an opaque type [#10664](https://github.com/lampepfl/dotty/pull/10664)
116
-
- Fix [#8634](https://github.com/lampepfl/dotty/issues/8634): Support -release option [#10746](https://github.com/lampepfl/dotty/pull/10746) – the same way Scala 2 does. This setting allows you to specify a version of the Java platform (8, 9 etc) and compile the code with classes specific to the that Java platform, and emit the bytecode for that version.
129
+
- Fix [#8634](https://github.com/lampepfl/dotty/issues/8634): Support -release option [#10746](https://github.com/lampepfl/dotty/pull/10746) – the same way Scala 2 does.
130
+
This setting allows you to specify a version of the Java platform (8, 9 etc) and compile the code with classes specific to the that Java platform, and emit the bytecode for that version.
131
+
132
+
## Metaprogramming changes
117
133
118
-
# Metaprogramming changes
119
134
A lot of work has been done on the metaprogramming side of things. Mostly we are cleaning up and polishing the API to prepare it for the stable release. The following are the important metaprogramming changes that took place:
120
135
121
136
- Add `scala.quoted.Expr.unapply` as dual of `Expr.apply`[#10580](https://github.com/lampepfl/dotty/pull/10580)
@@ -132,13 +147,14 @@ A lot of work has been done on the metaprogramming side of things. Mostly we are
132
147
- Rename `Not` to `NotGiven` to make its purpose clearer [#10720](https://github.com/lampepfl/dotty/pull/10720)
133
148
- Fix [#10709](https://github.com/lampepfl/dotty/issues/10709): Add missing level check before inlining [#10781](https://github.com/lampepfl/dotty/pull/10781)
134
149
135
-
# Let us know what you think!
150
+
## Let us know what you think!
151
+
136
152
If you have questions or any sort of feedback, feel free to send us a message on our
137
153
[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please
138
154
[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new).
139
155
140
-
141
156
## Contributors
157
+
142
158
Thank you to all the contributors who made this release possible 🎉
143
159
144
160
According to `git shortlog -sn --no-merges 3.0.0-M3..3.0.0-RC1` these are:
0 commit comments