Skip to content

Commit 806386e

Browse files
committed
Pick correct forwarder to avoid clashes
We should pick the one which is better, but we mistakenly chose the worst one instead, since I misinterpreted the ordering.
1 parent fed2764 commit 806386e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ class Namer { typer: Typer =>
12661266
|and ${forwarder1.rhs.symbol}: ${alt2.widen}
12671267
|have the same signature after erasure and overloading resolution could not disambiguate.""",
12681268
exp.srcPos)
1269-
avoidClashWith(if cmp < 0 then forwarder else forwarder1, forwarders1)
1269+
avoidClashWith(if cmp < 0 then forwarder1 else forwarder, forwarders1)
12701270
else
12711271
val (forwarder2, forwarders2) = avoidClashWith(forwarder, forwarders1)
12721272
(forwarder2, forwarders.derivedCons(forwarder1, forwarders2))

0 commit comments

Comments
 (0)