Skip to content

Commit 98ec84d

Browse files
committed
Fix code snippets
1 parent 65864dd commit 98ec84d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Other changes to type classes involve the stabilisation of context bounds for ty
7979
This mechanism allows defining an abstract given instance that needs to be provided by a class implementing the trait that defines an abstract given.
8080

8181
```scala
82+
trait Order[T]
83+
8284
trait Collection:
8385
// abstract member context-bound
8486
type Element: Order
@@ -139,6 +141,7 @@ One of the new, experimental, features is the implementation of [SIP-57](https:/
139141
Some typical use cases might be looking up an expected entry in a dynamically loaded dictionary-like structure:
140142

141143
```scala
144+
//> using options -experimental
142145
trait AppConfig:
143146
def get(key: String): Option[String]
144147
val config: AppConfig = ???
@@ -155,8 +158,6 @@ This change should not affect the majority of users, however, it can lead to dif
155158
Resolution of implicits can slightly differ depending on whether we're requesting them using `implicit` or `using` parameter, or depending on whether they were defined using `implicit` or `given` keywords. The special behaviours were introduced to smoothen migration from Scala 2 to brand new implicits resolution in Scala 3.
156159
This change might also affect some of the projects that use compiler plugins or macros to inspect the implicit argument lists of the function calls - these might require some minor fixes, eg. when filtering symbols by their flags.
157160

158-
<!-- TODO: Create and link docs describing differences between given/implicit -->
159-
160161
## Work on a better scheme for given prioritization
161162

162163
In the [Scala 3.5.0 release notes](https://scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html) we've announced upcoming changes to givens, due to their peculiar problem with prioritization. Currently, the compiler always tries to select the instance with the most specific subtype of the requested type. In the future, it would change to always selecting the instance with the most general subtype that satisfies the context-bound.

0 commit comments

Comments
 (0)