Skip to content

Commit 5252b15

Browse files
committed
Align computeBaseClasses with checkedParentType
`checkedParentType` tests that the underlying class symbol of a type is a class. So `computeBaseClasses` should assume exactly the same property.
1 parent ce21f5a commit 5252b15

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,8 +1467,10 @@ object SymDenotations {
14671467
onBehalf.signalProvisional()
14681468
val builder = new BaseDataBuilder
14691469
for (p <- classParents) {
1470-
if (p.typeSymbol.isClass) builder.addAll(p.typeSymbol.asClass.baseClasses)
1471-
else assert(isRefinementClass || ctx.mode.is(Mode.Interactive), s"$this has non-class parent: $p")
1470+
p.underlyingClassRef(refinementOK = false).typeSymbol match {
1471+
case pcls: ClassSymbol => builder.addAll(pcls.baseClasses)
1472+
case _ => assert(isRefinementClass || ctx.mode.is(Mode.Interactive), s"$this has non-class parent: $p")
1473+
}
14721474
}
14731475
(classSymbol :: builder.baseClasses, builder.baseClassSet)
14741476
}

tests/neg/parser-stability-12.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait x0[]
2+
trait x1[x1 <:x0]
3+
extends x1[

0 commit comments

Comments
 (0)