File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,17 @@ object Denotations {
308
308
else if (! sym2.exists) sym1
309
309
else if (preferSym(sym2, sym1)) sym2
310
310
else sym1
311
- new JointRefDenotation (sym, info1 & info2, denot1.validFor & denot2.validFor)
311
+ val jointInfo =
312
+ try info1 & info2
313
+ catch {
314
+ case ex : MergeError =>
315
+ if (pre.widen.classSymbol.is(Scala2x ))
316
+ info1 // follow Scala2 linearization -
317
+ // compare with way merge is performed in SymDenotation#computeMembersNamed
318
+ else
319
+ throw new MergeError (s " ${ex.getMessage} as members of type ${pre.show}" )
320
+ }
321
+ new JointRefDenotation (sym, jointInfo, denot1.validFor & denot2.validFor)
312
322
}
313
323
}
314
324
} else NoDenotation
Original file line number Diff line number Diff line change @@ -1057,6 +1057,8 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1057
1057
println(TypeComparer.explained { implicit ctx => tp1 <:< tp2})
1058
1058
assert(false, s"andConflict ${tp1.show} and ${tp2.show}")
1059
1059
*/
1060
+ if (! ctx.isAfterTyper && ! ctx.mode.is(Mode .Scala2Unpickling ))
1061
+ throw new MergeError (msg)
1060
1062
ctx.warning(msg, ctx.tree.pos)
1061
1063
winner
1062
1064
}
Original file line number Diff line number Diff line change @@ -492,10 +492,8 @@ object Types {
492
492
493
493
try go(this )
494
494
catch {
495
- case ex : MergeError =>
496
- throw new MergeError (s " ${ex.getMessage} as members of type ${pre.show}" )
497
495
case ex : Throwable =>
498
- ctx .println(i " findMember exception for $this member $name" )
496
+ core .println(i " findMember exception for $this member $name" )
499
497
throw ex // DEBUG
500
498
}
501
499
finally {
Original file line number Diff line number Diff line change
1
+ trait A { trait Inner }
2
+ trait B { self : A =>
3
+ trait Inner extends self.Inner
4
+ }
5
+
6
+
7
+ class C extends C
You can’t perform that action at this time.
0 commit comments