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
@@ -101,21 +123,21 @@ warnings when the choice of `given` has changed:
101
123
| (libComponent : LibComponent)
102
124
| has changed.
103
125
|Previouschoice : the first alternative
104
-
|New choice from Scala3.6: the second alternative
126
+
|New choice from Scala3.7: the second alternative
105
127
```
106
128
129
+
Additionally, you can compile with `-source 3.7` or `-source future`
130
+
to fully enable the new prioritization and start experiencing its
131
+
effects.
132
+
133
+
**Scala 3.6**
107
134
108
-
### Useful Compiler Options
135
+
In Scala 3.6, these warnings will be on by default.
109
136
110
-
In future releases (Scala 3.6+), automatic warnings related to changes
111
-
in the selection of givens, as described above, will no longer be
112
-
issued by default. However, these warnings can be reactivated using
113
-
the `-source:3.5` option with `scalac`.
137
+
**Scala 3.7**
114
138
115
-
Additionally, combining Scala 3.5 with the `-source:3.6` option can be
116
-
useful to verify that implicit search results will not be ambiguous in
117
-
future versions or to test your application at runtime with the new
118
-
rules in effect.
139
+
Scala 3.7 will finalize the transition, making the new given
140
+
prioritization the standard behavior.
119
141
120
142
#### Suppressing Warnings
121
143
@@ -146,17 +168,22 @@ val x = summon[A]
146
168
147
169
For more details, you can consult the guide on [configuring and suppressing warnings]({{ site.baseurl }}/2021/01/12/configuring-and-suppressing-warnings.html).
148
170
149
-
### Resorting to Explicit Parameters
171
+
### Workarounds
150
172
151
-
If the pre-3.5 behavior is preferred, you can explicitly pass the
173
+
Here are some practical strategies to help you smoothly adapt to the
174
+
new given resolution scheme:
175
+
176
+
#### Resorting to Explicit Parameters
177
+
178
+
If the pre-3.7 behavior is preferred, you can explicitly pass the
152
179
desired given:
153
180
```scala
154
181
@main defrun= printComponent(using userComponent)
155
182
```
156
183
157
184
To determine the correct explicit parameter (which could involve a
158
-
complex expression), it can be helpful to compile with Scala 3.4 (or
159
-
earlier) using the `-Xprint:typer` flag:
185
+
complex expression), it can be helpful to compile with an earlier
186
+
Scala version using the `-Xprint:typer` flag:
160
187
```scala
161
188
scalac client.scala -Xprint:typer
162
189
```
@@ -167,10 +194,10 @@ This will output all parameters explicitly:
167
194
...
168
195
```
169
196
170
-
### Explicit Prioritization by Owner
197
+
####Explicit Prioritization by Owner
171
198
172
199
One effective way to ensure that the most specific given instance is
173
-
selected -— particularly useful when migrating libraries to Scala 3.5 -—
200
+
selected -— particularly useful when migrating libraries to Scala 3.7 -—
174
201
is to leverage the inheritance rules as outlined in point 8 of [the
0 commit comments