diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 7dd741666cdb..6976de7225ba 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -909,9 +909,9 @@ class Namer { typer: Typer => // the parent types are elaborated. index(constr) annotate(constr :: params) - symbolOfTree(constr).ensureCompleted() indexAndAnnotate(rest)(inClassContext(selfInfo)) + symbolOfTree(constr).ensureCompleted() val parentTypes = ensureFirstIsClass(parents.map(checkedParentType(_))) val parentRefs = ctx.normalizeToClassRefs(parentTypes, cls, decls) diff --git a/tests/pos/i2949.scala b/tests/pos/i2949.scala new file mode 100644 index 000000000000..bd493d46ec47 --- /dev/null +++ b/tests/pos/i2949.scala @@ -0,0 +1,3 @@ +class Foo(a: Foo#A) { + type A = Int +}