File tree 2 files changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1491,7 +1491,8 @@ class Typer extends Namer
1491
1491
def typedParent (tree : untpd.Tree ): Tree = {
1492
1492
var result = if (tree.isType) typedType(tree)(superCtx) else typedExpr(tree)(superCtx)
1493
1493
val psym = result.tpe.typeSymbol
1494
- if (seenParents.contains(psym)) ctx.error(i " $psym is extended twice " , tree.pos)
1494
+ if (seenParents.contains(psym) && ! cls.isRefinementClass)
1495
+ ctx.error(i " $psym is extended twice " , tree.pos)
1495
1496
seenParents += psym
1496
1497
if (tree.isType) {
1497
1498
if (psym.is(Trait ) && ! cls.is(Trait ) && ! cls.superClass.isSubClass(psym))
Original file line number Diff line number Diff line change
1
+ trait Test {
2
+ type A <: Any { type T }
3
+ type B <: Any { type T }
4
+ type C <: A with B { type T }
5
+
6
+ type D <: List [A ] with List [B ] { type T }
7
+ }
You can’t perform that action at this time.
0 commit comments