Skip to content

Commit 59282e6

Browse files
Add link to new givens prioritization blogpost
1 parent d85a47f commit 59282e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

blog/_posts/2024-08-21-scala-3.5.0-released.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ This is an implementation of [SIP-58](https://github.com/scala/improvement-propo
101101

102102
Givens in Scala 3 have a peculiar problem with prioritization. The compiler tries to always select the instance with *the most specific subtype* of the requested type. This can lead to confusing situations, when user faces ambiguity errors in code that should intuitively work. Changing the scheme of given prioritization to always select the instance with *the most general subtype* that satisfies the context bound, would resolve such cases. We have conducted experiments that showed that the proposed scheme will result in a more intuitive and predictable given resolution. The negative impact on the existing projects is very small. We have tested 1500 open-source libraries, and new rules are causing problems for less than a dozen of them. We have already submitted PRs with changes that will make them work the same way under both the current and proposed rules.
103103

104-
For the detailed motivation of changes with examples of code that will be easier to write and understand, see our recent blogpost //// TODO LINK
104+
For the detailed motivation of changes with examples of code that will be easier to write and understand, see our recent blogpost - [Upcoming Changes to Givens in Scala 3.7](https://scala-lang.org/2024/08/19/given-priority-change-3.7.html).
105105

106106
Our current plan is to introduce the new scheme in Scala 3.7. Starting from Scala 3.6, code whose behavior can differ between new and old rules (ambiguity on new, passing on old, or vice versa) will emit warnings, but the old rules will still be applied. 3.5 gives you a chance to detect if those changes affect your codebase. Running the compiler with `-source 3.6` will give you warnings; with `-source 3.7` or `-source future` you will get the new scheme.
107107

0 commit comments

Comments
 (0)