Skip to content

Commit 9fed768

Browse files
committed
Avoid merge errors in Scala2 mode
Linearize instead. It would be nice to be able to give a migration warning here, but unfortunately we do not have a position at the point the warning would be generated, and it feels like overkill to do another kind of exception that gets propagated and caught in typer.
1 parent 44d0727 commit 9fed768

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ object Denotations {
320320
try info1 & info2
321321
catch {
322322
case ex: MergeError =>
323-
if (pre.widen.classSymbol.is(Scala2x))
323+
if (pre.widen.classSymbol.is(Scala2x) || ctx.scala2Mode)
324324
info1 // follow Scala2 linearization -
325325
// compare with way merge is performed in SymDenotation#computeMembersNamed
326326
else

0 commit comments

Comments
 (0)