Skip to content

Commit ec395ea

Browse files
committed
Don't overhype new features and fix betterFors snippet
1 parent 45fcec9 commit ec395ea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

_posts/2024-12-05-release-notes-3.6.2.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We apologize to the Scala users for any inconvenience it might have caused.
2020

2121
# What’s new in Scala 3.6?
2222

23-
Besides multiple bugfixes, this release stabilises multiple experimental features introduced to Scala language after careful review and acceptance by the [Scala Improvement Proposal's Commitee](https://docs.scala-lang.org/sips/). Many of these changes can have a significant impact on the Scala syntax and are introducing new amazing possibilities in writing concise, typesafe as well as easier, and easier to maintain code.
23+
Besides multiple bugfixes, this release stabilises multiple experimental features introduced to Scala language after careful review and acceptance by the [Scala Improvement Proposal's Commitee](https://docs.scala-lang.org/sips/). Many of these changes can have a significant impact on the Scala syntax and are introducing new possibilities in writing concise, typesafe as well as easier, and easier to maintain code.
2424

2525
## SIP-47 - Clause Interleaving
2626

@@ -121,11 +121,13 @@ Starting with Scala 3.6.2 you can take advantage of improvements to the for-comp
121121
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:
122122

123123
```scala
124+
//> using options -experimental -language:experimental.betterFors
125+
@main def betterFors =
124126
for
125127
a = 1
126128
b <- Some(2)
127-
c <- doSth(a)
128-
yield b + c
129+
c <- Option.when(a < 5)(10)
130+
yield b * c
129131
```
130132

131133
It also introduces changes to how your code is desugared by the compiler, leading to a more optimized code by removing some redundant calls.

0 commit comments

Comments
 (0)