Skip to content

Commit 5f7ef0c

Browse files
committed
Survive empty base classes in overriddenFromType
1 parent 95efbb1 commit 5f7ef0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,10 @@ object SymDenotations {
10561056
else overriddenFromType(owner.asClass.classInfo.selfType)
10571057

10581058
private def overriddenFromType(tp: Type)(implicit ctx: Context): Iterator[Symbol] =
1059-
tp.baseClasses.tail.iterator map overriddenSymbol filter (_.exists)
1059+
tp.baseClasses match {
1060+
case _ :: inherited => inherited.iterator map overriddenSymbol filter (_.exists)
1061+
case Nil => Iterator.empty
1062+
}
10601063

10611064
/** The symbol overriding this symbol in given subclass `ofclazz`.
10621065
*

0 commit comments

Comments
 (0)