File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -240,18 +240,18 @@ object Implicits:
240240 else
241241 val nestedCtx = ctx.fresh.addMode(Mode .TypevarsMissContext )
242242 val candidates = new mutable.ListBuffer [Candidate ]
243- var extensionOnly = true
244-
245- val tryCandidate = (ref : ImplicitRef ) =>
243+ def tryCandidate (extensionOnly : Boolean )(ref : ImplicitRef ) =
246244 var ckind = explore(candidateKind(ref.underlyingRef))(using nestedCtx)
247245 if extensionOnly then ckind &= Candidate .Extension
248246 if ckind != Candidate .None then
249247 candidates += Candidate (ref, ckind, level)
250248
251249 if considerExtension then
252- companionRefs.foreach(tryCandidate)
253- extensionOnly = false
254- refs.foreach(tryCandidate)
250+ val tryExtension = tryCandidate(extensionOnly = true )
251+ companionRefs.foreach(tryExtension)
252+ if refs.nonEmpty then
253+ val tryGiven = tryCandidate(extensionOnly = false )
254+ refs.foreach(tryGiven)
255255 candidates.toList
256256 }
257257 }
You can’t perform that action at this time.
0 commit comments