File tree 2 files changed +9
-8
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -483,16 +483,17 @@ object Checking {
483
483
}
484
484
tp1
485
485
case tp : ClassInfo =>
486
+ def transformedParent (tp : Type ): Type = tp match {
487
+ case ref : TypeRef => ref
488
+ case ref : AppliedType => ref
489
+ case AnnotatedType (parent, annot) =>
490
+ AnnotatedType (transformedParent(parent), annot)
491
+ case _ => defn.ObjectType // can happen if class files are missing
492
+ }
486
493
tp.derivedClassInfo(
487
494
prefix = apply(tp.prefix),
488
495
classParents =
489
- tp.parents.map { p =>
490
- apply(p).stripAnnots match {
491
- case ref : TypeRef => ref
492
- case ref : AppliedType => ref
493
- case _ => defn.ObjectType // can happen if class files are missing
494
- }
495
- }
496
+ tp.parents.map { p => transformedParent(apply(p)) }
496
497
)
497
498
case _ =>
498
499
mapOver(tp)
Original file line number Diff line number Diff line change @@ -888,7 +888,7 @@ class Namer { typer: Typer =>
888
888
* (4) If the class is sealed, it is defined in the same compilation unit as the current class
889
889
*/
890
890
def checkedParentType (parent : untpd.Tree ): Type = {
891
- val ptype = parentType(parent)(ctx.superCallContext).dealias
891
+ val ptype = parentType(parent)(ctx.superCallContext).dealiasKeepAnnots
892
892
if (cls.isRefinementClass) ptype
893
893
else {
894
894
val pt = checkClassType(ptype, parent.pos,
You can’t perform that action at this time.
0 commit comments