@@ -1320,14 +1320,14 @@ trait Implicits:
1320
1320
* 3.6 and higher: compare with preferGeneral = true
1321
1321
*
1322
1322
*/
1323
- def compareAlternatives (alt1 : RefAndLevel , alt2 : RefAndLevel ): Int =
1323
+ def compareAlternatives (alt1 : RefAndLevel , alt2 : RefAndLevel , reportChanges : Boolean = false ): Int =
1324
1324
def comp (using Context ) = explore(compare(alt1.ref, alt2.ref, preferGeneral = true ))
1325
1325
def warn (msg : Message ) =
1326
- priorityChangeWarnings += ((alt1.ref, alt2.ref, msg))
1326
+ if reportChanges then priorityChangeWarnings += ((alt1.ref, alt2.ref, msg))
1327
1327
if alt1.ref eq alt2.ref then 0
1328
1328
else if alt1.level != alt2.level then alt1.level - alt2.level
1329
1329
else
1330
- var cmp = comp(using searchContext())
1330
+ val cmp = comp(using searchContext())
1331
1331
val sv = Feature .sourceVersion
1332
1332
if sv.stable == SourceVersion .`3.5` || sv == SourceVersion .`3.6-migration` then
1333
1333
val prev = comp(using searchContext().addMode(Mode .OldImplicitResolution ))
@@ -1358,7 +1358,7 @@ trait Implicits:
1358
1358
*/
1359
1359
def disambiguate (alt1 : SearchResult , alt2 : SearchSuccess ) = alt1 match
1360
1360
case alt1 : SearchSuccess =>
1361
- var diff = compareAlternatives(alt1, alt2)
1361
+ var diff = compareAlternatives(alt1, alt2, reportChanges = true )
1362
1362
assert(diff <= 0 ) // diff > 0 candidates should already have been eliminated in `rank`
1363
1363
if diff == 0 && alt1.ref =:= alt2.ref then
1364
1364
diff = 1 // See i12951 for a test where this happens
0 commit comments