diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index b43391592bad..4b5b4476d2c8 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -400,8 +400,14 @@ object Checking { case tp: ClassInfo => tp.derivedClassInfo( prefix = apply(tp.prefix), - classParents = tp.parentsWithArgs.map(p => - apply(p).underlyingClassRef(refinementOK = false).asInstanceOf[TypeRef])) + classParents = + tp.parentsWithArgs.map { p => + apply(p).underlyingClassRef(refinementOK = false) match { + case ref: TypeRef => ref + case _ => defn.ObjectType // can happen if class files are missing + } + } + ) case _ => mapOver(tp) }