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