@@ -1170,7 +1170,7 @@ object SymDenotations {
1170
1170
{ // simulate default parameters, while also passing implicit context ctx to the default values
1171
1171
val initFlags1 = (if (initFlags != UndefinedFlags ) initFlags else this .flags) &~ Frozen
1172
1172
val info1 = if (info != null ) info else this .info
1173
- if (ctx.isAfterTyper && changedClassParents(info, info1))
1173
+ if (ctx.isAfterTyper && changedClassParents(info, info1, completersMatter = false ))
1174
1174
assert(ctx.phase.changesParents, i " undeclared parent change at ${ctx.phase} for $this, was: $info, now: $info1" )
1175
1175
val privateWithin1 = if (privateWithin != null ) privateWithin else this .privateWithin
1176
1176
val annotations1 = if (annotations != null ) annotations else this .annotations
@@ -1185,15 +1185,17 @@ object SymDenotations {
1185
1185
*/
1186
1186
def copyCaches (from : SymDenotation , phase : Phase )(implicit ctx : Context ): this .type = this
1187
1187
1188
- /** Are `info1` and `info2` ClassInfo types with different parents? */
1189
- protected def changedClassParents (info1 : Type , info2 : Type ): Boolean =
1188
+ /** Are `info1` and `info2` ClassInfo types with different parents?
1189
+ * @param completersMatter if `true`, consider parents changed if `info1` or `info2 `is a type completer
1190
+ */
1191
+ protected def changedClassParents (info1 : Type , info2 : Type , completersMatter : Boolean ): Boolean =
1190
1192
info2 match {
1191
1193
case info2 : ClassInfo =>
1192
1194
info1 match {
1193
1195
case info1 : ClassInfo => info1.classParents ne info2.classParents
1194
- case _ => false
1196
+ case _ => completersMatter
1195
1197
}
1196
- case _ => false
1198
+ case _ => completersMatter
1197
1199
}
1198
1200
1199
1201
override def initial : SymDenotation = super .initial.asSymDenotation
@@ -1307,12 +1309,11 @@ object SymDenotations {
1307
1309
}
1308
1310
1309
1311
override protected [dotc] final def info_= (tp : Type ) = {
1310
- super .info_=(tp)
1311
- if (changedClassParents(infoOrCompleter, tp) || true ) {
1312
+ if (changedClassParents(infoOrCompleter, tp, completersMatter = true ))
1312
1313
invalidateBaseDataCache()
1313
- }
1314
1314
invalidateMemberNamesCache()
1315
1315
myTypeParams = null // changing the info might change decls, and with it typeParams
1316
+ super .info_=(tp)
1316
1317
}
1317
1318
1318
1319
/** The denotations of all parents in this class. */
0 commit comments