File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -338,10 +338,13 @@ object Implicits:
338
338
if (monitored) record(s " check eligible refs in irefCtx " , refs.length)
339
339
val ownEligible = filterMatching(tp)
340
340
if (isOuterMost) ownEligible
341
- else ownEligible ::: {
342
- val shadowed = ownEligible.map(_.ref.implicitName).toSet
343
- outerImplicits.eligible(tp).filterNot(cand => shadowed.contains(cand.ref.implicitName))
344
- }
341
+ else if ownEligible.isEmpty then outerImplicits.eligible(tp)
342
+ else
343
+ val outerEligible = outerImplicits.eligible(tp)
344
+ if outerEligible.isEmpty then ownEligible
345
+ else
346
+ val shadowed = ownEligible.map(_.ref.implicitName).toSet
347
+ ownEligible ::: outerEligible.filterConserve(cand => ! shadowed.contains(cand.ref.implicitName))
345
348
}
346
349
347
350
override def isAccessible (ref : TermRef )(using Context ): Boolean =
You can’t perform that action at this time.
0 commit comments