Skip to content

Commit

Permalink
Fix ranking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Aug 5, 2024
1 parent 6b1f49f commit e491c87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1368,9 +1368,9 @@ trait Implicits:
|Previous choice : ${choice(prev)}
|New choice from Scala 3.7: ${choice(cmp)}""")
cmp
else cmp max prev
// When ranking, we keep the better of cmp and prev, which ends up retaining a candidate
// if it is retained in either version.
else if cmp != prev then
0 // When ranking, we retain a candidate if it is retained in either version.
else cmp
else cmp
end compareAlternatives

Expand Down
1 change: 1 addition & 0 deletions tests/pos/i15264.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import language.`3.7`
object priority:
// lower number = higher priority
class Prio0 extends Prio1
Expand Down

0 comments on commit e491c87

Please sign in to comment.