@@ -2226,18 +2226,20 @@ trait Applications extends Compatibility {
2226
2226
record(s " resolveOverloaded1 " , alts.length)
2227
2227
2228
2228
val sv = Feature .sourceVersion
2229
- val isOldPriorityVersion : Boolean = sv.isAtMost(SourceVersion .`3.6 `)
2230
- val isWarnPriorityChangeVersion = sv == SourceVersion .`3.6 ` || sv == SourceVersion .`3.7 -migration`
2229
+ val isOldPriorityVersion : Boolean = sv.isAtMost(SourceVersion .`3.7 `)
2230
+ val isWarnPriorityChangeVersion = sv == SourceVersion .`3.7 ` || sv == SourceVersion .`3.8 -migration`
2231
2231
2232
- inline def warnOnPriorityChange (oldCands : List [TermRef ], newCands : List [TermRef ])(f : List [TermRef ] => List [TermRef ]): List [TermRef ] =
2232
+ def warnOnPriorityChange (oldCands : List [TermRef ], newCands : List [TermRef ])(f : List [TermRef ] => List [TermRef ]): List [TermRef ] =
2233
+ lazy val oldRes = f(oldCands)
2234
+ val newRes = f(newCands)
2233
2235
2234
2236
def doWarn (oldChoice : String , newChoice : String ): Unit =
2235
2237
val (change, whichChoice) =
2236
2238
if isOldPriorityVersion
2237
2239
then (" will change" , " Current choice " )
2238
2240
else (" has changed" , " Previous choice" )
2239
2241
2240
- val msg = // uses oldCands as the list of alternatives since they should be a superset of newCands
2242
+ val msg = // using oldCands to list the alternatives as they should be a superset of newCands
2241
2243
em """ Overloading resolution for ${err.expectedTypeStr(pt)} between alternatives
2242
2244
| ${oldCands map (_.info)}%\n %
2243
2245
| $change.
@@ -2247,9 +2249,6 @@ trait Applications extends Compatibility {
2247
2249
report.warning(msg, srcPos)
2248
2250
end doWarn
2249
2251
2250
- lazy val oldRes = f(oldCands)
2251
- val newRes = f(newCands)
2252
-
2253
2252
if isWarnPriorityChangeVersion then (oldRes, newRes) match
2254
2253
case (oldAlt :: Nil , newAlt :: Nil ) if oldAlt != newAlt => doWarn(oldAlt.info.show, newAlt.info.show)
2255
2254
case (oldAlt :: Nil , Nil ) => doWarn(oldAlt.info.show, " none" )
0 commit comments