Skip to content

Commit f5bfc81

Browse files
Fix #9058: the sorting function's if-statements for implicit lookup are 'total'
'Total' in the sense of explicitly specifying all possible cases. See https://stackoverflow.com/a/11441813 for a similar error.
1 parent cf8f01a commit f5bfc81

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,7 @@ trait Implicits { self: Typer =>
11741174
if (ownerScore < 0) return false
11751175
val arity1 = sym1.info.firstParamTypes.length
11761176
val arity2 = sym2.info.firstParamTypes.length
1177-
if (arity1 < arity2) return true
1178-
if (arity1 > arity2) return false
1179-
false
1177+
arity1 < arity2
11801178
}
11811179

11821180
/** Sort list of implicit references according to `prefer`.

0 commit comments

Comments
 (0)