File tree 1 file changed +6
-6
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -240,18 +240,18 @@ object Implicits:
240
240
else
241
241
val nestedCtx = ctx.fresh.addMode(Mode .TypevarsMissContext )
242
242
val candidates = new mutable.ListBuffer [Candidate ]
243
- var extensionOnly = true
244
-
245
- val tryCandidate = (ref : ImplicitRef ) =>
243
+ def tryCandidate (extensionOnly : Boolean )(ref : ImplicitRef ) =
246
244
var ckind = explore(candidateKind(ref.underlyingRef))(using nestedCtx)
247
245
if extensionOnly then ckind &= Candidate .Extension
248
246
if ckind != Candidate .None then
249
247
candidates += Candidate (ref, ckind, level)
250
248
251
249
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)
255
255
candidates.toList
256
256
}
257
257
}
You can’t perform that action at this time.
0 commit comments