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: _posts/2024-12-05-release-notes-3.6.2.md
+70-65Lines changed: 70 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,71 +24,6 @@ trait DB {
24
24
}
25
25
```
26
26
27
-
## SIP-58 - Named Tuples
28
-
29
-
Another stabilized feature in this release are the Named Tuples. These have been introduced as experimental in Scala 3.5.0 and allowed you to give meaningful names to tuple elements and use those names during constructing, destructuring, and pattern matching.
This change also introduces improvements to extractors of case classes. You can now define named extractors for a selection of fields, allowing you to unclutter your code from unused variables.
You can read more about named tuples in the [dedicated section of Scala 3 reference documentation](https://scala-lang.org/api/3.6.2/docs/docs/reference/other-new-features/named-tuples.html).
76
-
77
-
## SIP-62 - For-Comprehension Improvements
78
-
79
-
Starting with Scala 3.6.2 you can take advantage of improvements to the for-comprehesnions syntax.
80
-
Major user-facing improvement introduced by [SIP-62](https://docs.scala-lang.org/sips/better-fors.html) is the ability to start a for-comprehension block with aliases:
81
-
82
-
```scala
83
-
for
84
-
a =1
85
-
b <-Some(2)
86
-
c <- doSth(a)
87
-
yield b + c
88
-
```
89
-
90
-
It also introduces changes to how your code is desugared by the compiler, leading to a more optimized code by removing some redundant calls.
91
-
92
27
## SIP-64 - Improve Syntax for Context Bounds and Givens
93
28
94
29
This release stabilises the [SIP-64](https://docs.scala-lang.org/sips/sips/typeclasses-syntax.html) introduced as experimental in Scala 3.5.0. These changes provide you with the new syntax for defining type class instances.
@@ -170,6 +105,21 @@ type InvF[Y] = Y match
170
105
defTest= summon[InvF[B] =:=String] // was error: selector B does not uniquely determine parameter x
Starting with Scala 3.6.2 you can take advantage of improvements to the for-comprehesnions syntax.
111
+
Major user-facing improvement introduced by [SIP-62](https://docs.scala-lang.org/sips/better-fors.html) is the ability to start a for-comprehension block with aliases:
112
+
113
+
```scala
114
+
for
115
+
a =1
116
+
b <-Some(2)
117
+
c <- doSth(a)
118
+
yield b + c
119
+
```
120
+
121
+
It also introduces changes to how your code is desugared by the compiler, leading to a more optimized code by removing some redundant calls.
One of the new, experimental, features is the implementation of [SIP-57](https://docs.scala-lang.org/sips/replace-nonsensical-unchecked-annotation.html) introducing a `runtimeChecked` extension method replacing some usages of `@unchecked` annotation using a more convenient syntax. A common use case for `runtimeChecked` is to assert that a pattern will always match, either for convenience or because there is a known invariant that the types can not express.
@@ -220,6 +170,61 @@ Reordering the fields is binary-compatible but it might affect the meaning of `@
220
170
Starting from Scala 3.6, named arguments are required for Java-defined annotations.
221
171
The compiler can provide you with automatic rewrites introducing now required names, using `-source:3.6-migration, -rewrite` flags. The rewrites are done on a best-effort basis and should be inspected for correctness by the users.
222
172
173
+
## Experimental SIP-58 - Named Tuples
174
+
175
+
Named Tuples have been introduced as experimental in Scala 3.5.0. This feature is now ready to be tested, but is not yet stablized.
176
+
We encourage you to try named tuples and to report your feedback [on the public forum](https://contributors.scala-lang.org/t/pre-sip-named-tuples).
177
+
Named Tuples allow you to give meaningful names to tuple elements and use those names during constructing, destructuring, and pattern matching.
This change also introduces improvements to extractors of case classes. You can now define named extractors for a selection of fields, allowing you to unclutter your code from unused variables.
You can read more about named tuples in the [dedicated section of Scala 3 reference documentation](https://scala-lang.org/api/3.6.2/docs/docs/reference/experimental/named-tuples.html).
0 commit comments