File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1330,13 +1330,13 @@ trait Implicits:
13301330 if alt1.ref eq alt2.ref then 0
13311331 else if alt1.level != alt2.level then alt1.level - alt2.level
13321332 else
1333- var cmp = comp(using searchContext())
1334- if cmp == 0 && alt1.ref.symbol.is( Implicit ) && alt2.ref.symbol.is( Implicit ) then
1333+ lazy val prev = comp(using searchContext().addMode( Mode . OldImplicitResolution ))
1334+ val cmp = comp( using searchContext()) match
13351335 // if we get an ambiguity with new rules for a pair of old-style implicits, fall back to old rules
1336- cmp = comp(using searchContext().addMode(Mode .OldImplicitResolution ))
1336+ case 0 if alt1.ref.symbol.is(Implicit ) && alt2.ref.symbol.is(Implicit ) => prev
1337+ case cmp => cmp
13371338 val sv = Feature .sourceVersion
13381339 if isWarnPriorityChangeVersion(sv) then
1339- val prev = comp(using searchContext().addMode(Mode .OldImplicitResolution ))
13401340 if disambiguate && cmp != prev then
13411341 def warn (msg : Message ) =
13421342 val critical = alt1.ref :: alt2.ref :: Nil
You can’t perform that action at this time.
0 commit comments