Skip to content

Commit 3188b43

Browse files
committed
Avoid double-counting of extension methods
1 parent 40667a6 commit 3188b43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ object Implicits {
249249

250250
val extensionCandidates =
251251
if considerExtension then
252-
companionRefs.toList.flatMap(matchingCandidate(_, extensionOnly = true))
252+
companionRefs.toList
253+
.filterConserve(!_.symbol.isOneOf(GivenOrImplicit)) // implicit objects are already in `refs`
254+
.flatMap(matchingCandidate(_, extensionOnly = true))
253255
else
254256
Nil
255257
val implicitCandidates =

0 commit comments

Comments
 (0)