Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,8 @@ class Typer extends Namer
def typedParent(tree: untpd.Tree): Tree = {
var result = if (tree.isType) typedType(tree)(superCtx) else typedExpr(tree)(superCtx)
val psym = result.tpe.typeSymbol
if (seenParents.contains(psym)) ctx.error(i"$psym is extended twice", tree.pos)
if (seenParents.contains(psym) && !cls.isRefinementClass)
ctx.error(i"$psym is extended twice", tree.pos)
seenParents += psym
if (tree.isType) {
if (psym.is(Trait) && !cls.is(Trait) && !cls.superClass.isSubClass(psym))
Expand Down
7 changes: 7 additions & 0 deletions tests/pos/i4623.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
trait Test {
type A <: Any { type T }
type B <: Any { type T }
type C <: A with B { type T }

type D <: List[A] with List[B] { type T }
}