@@ -1310,6 +1310,10 @@ trait Implicits:
1310
1310
// message if one of the critical candidates is part of the result of the implicit search.
1311
1311
val priorityChangeWarnings = mutable.ListBuffer [(/* critical:*/ List [TermRef ], Message )]()
1312
1312
1313
+ val sv = Feature .sourceVersion
1314
+ val isLastOldVersion = sv.stable == SourceVersion .`3.6`
1315
+ val isWarnPriorityChangeVersion = isLastOldVersion || sv == SourceVersion .`3.7-migration`
1316
+
1313
1317
/** Compare `alt1` with `alt2` to determine which one should be chosen.
1314
1318
*
1315
1319
* @return a number > 0 if `alt1` is preferred over `alt2`
@@ -1333,10 +1337,7 @@ trait Implicits:
1333
1337
else if alt1.level != alt2.level then alt1.level - alt2.level
1334
1338
else
1335
1339
val cmp = comp(using searchContext())
1336
- val sv = Feature .sourceVersion
1337
- val isLastOldVersion = sv.stable == SourceVersion .`3.6`
1338
- val isMigratingVersion = sv == SourceVersion .`3.7-migration`
1339
- if isLastOldVersion || isMigratingVersion then
1340
+ if isWarnPriorityChangeVersion then
1340
1341
val prev = comp(using searchContext().addMode(Mode .OldImplicitResolution ))
1341
1342
if disambiguate && cmp != prev then
1342
1343
implicits.println(i " PRIORITY CHANGE ${alt1.ref}, ${alt2.ref}" )
@@ -1452,7 +1453,8 @@ trait Implicits:
1452
1453
1453
1454
val newPending = remaining.filter(betterThanAll(_, disambiguate = false ))
1454
1455
rank(newPending, fail, Nil ) match
1455
- case found : SearchSuccess if betterThanAll(found, disambiguate = true ) => found
1456
+ case found : SearchSuccess
1457
+ if ! isWarnPriorityChangeVersion || betterThanAll(found, disambiguate = true ) => found
1456
1458
case _ => fail
1457
1459
1458
1460
negateIfNot(tryImplicit(cand, contextual)) match {
0 commit comments