Skip to content

Commit 1ea5485

Browse files
committed
Use "prefer owner score over type score" trick only under new resolution rules
That way, we see the difference if something changes.
1 parent 39c49ad commit 1ea5485

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,9 @@ trait Applications extends Compatibility {
19801980
// Reason: People use owner hierarchies to explicitly prioritize, we should not
19811981
// break that by changing implicit priority of types. On the other hand we do want
19821982
// to comparePrefixes if there is a draw; StringFormaterTest breaks if we don't do that.
1983-
def drawOrOwner = if preferGeneral then ownerScore else 0
1983+
def drawOrOwner =
1984+
if preferGeneral && !ctx.mode.is(Mode.OldImplicitResolution) then ownerScore
1985+
else 0
19841986
ownerScore match
19851987
case 1 => if winsType1 || !winsType2 then 1 else drawOrOwner
19861988
case -1 => if winsType2 || !winsType1 then -1 else drawOrOwner

0 commit comments

Comments
 (0)