@@ -1182,21 +1182,17 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1182
1182
/** Compare to alternatives of an overloaded call or an implicit search.
1183
1183
*
1184
1184
* @param alt1, alt2 Non-overloaded references indicating the two choices
1185
- * @param level1, level2 If alternatives come from a comparison of two contextual
1186
- * implicit candidates, the nesting levels of the candidates.
1187
- * In all other cases the nesting levels are both 0.
1188
1185
* @return 1 if 1st alternative is preferred over 2nd
1189
1186
* -1 if 2nd alternative is preferred over 1st
1190
1187
* 0 if neither alternative is preferred over the other
1191
1188
*
1192
1189
* An alternative A1 is preferred over an alternative A2 if it wins in a tournament
1193
1190
* that awards one point for each of the following:
1194
1191
*
1195
- * - A1 is nested more deeply than A2
1196
- * - The nesting levels of A1 and A2 are the same, and A1's owner derives from A2's owner
1192
+ * - A1's owner derives from A2's owner.
1197
1193
* - A1's type is more specific than A2's type.
1198
1194
*/
1199
- def compare (alt1 : TermRef , alt2 : TermRef , nesting1 : Int = 0 , nesting2 : Int = 0 )(implicit ctx : Context ): Int = track(" compare" ) { trace(i " compare( $alt1, $alt2) " , overload) {
1195
+ def compare (alt1 : TermRef , alt2 : TermRef )(implicit ctx : Context ): Int = track(" compare" ) { trace(i " compare( $alt1, $alt2) " , overload) {
1200
1196
1201
1197
assert(alt1 ne alt2)
1202
1198
@@ -1306,10 +1302,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
1306
1302
1307
1303
val owner1 = if (alt1.symbol.exists) alt1.symbol.owner else NoSymbol
1308
1304
val owner2 = if (alt2.symbol.exists) alt2.symbol.owner else NoSymbol
1309
- val ownerScore =
1310
- if (nesting1 > nesting2) 1
1311
- else if (nesting1 < nesting2) - 1
1312
- else compareOwner(owner1, owner2)
1305
+ val ownerScore = compareOwner(owner1, owner2)
1313
1306
1314
1307
val tp1 = stripImplicit(alt1.widen)
1315
1308
val tp2 = stripImplicit(alt2.widen)
0 commit comments