Skip to content

Commit 254665e

Browse files
committed
Fix to baseClasses.
Need to be invalidated on new run along with superClassButs and baseTypes. Fixes a stale symbol error discovered when compiling dotc.core with erasure turned on.
1 parent eadfa6a commit 254665e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,11 @@ object SymDenotations {
10181018
private[this] var myBaseClasses: List[ClassSymbol] = null
10191019
private[this] var mySuperClassBits: BitSet = null
10201020

1021-
/** Invalidate baseTypeRefCache and superClassBits on new run */
1021+
/** Invalidate baseTypeRefCache, baseClasses and superClassBits on new run */
10221022
private def checkBasesUpToDate()(implicit ctx: Context) =
10231023
if (baseTypeRefValid != ctx.runId) {
10241024
baseTypeRefCache = new java.util.HashMap[CachedType, Type]
1025+
myBaseClasses = null
10251026
mySuperClassBits = null
10261027
baseTypeRefValid = ctx.runId
10271028
}
@@ -1069,6 +1070,7 @@ object SymDenotations {
10691070
def baseClasses(implicit ctx: Context): List[ClassSymbol] =
10701071
if (classParents.isEmpty) classSymbol :: Nil // can happen when called too early in Namers
10711072
else {
1073+
checkBasesUpToDate()
10721074
if (myBaseClasses == null) computeBases
10731075
myBaseClasses
10741076
}

0 commit comments

Comments
 (0)