File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -483,16 +483,17 @@ object Checking {
483483 }
484484 tp1
485485 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+ }
486493 tp.derivedClassInfo(
487494 prefix = apply(tp.prefix),
488495 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)))
496497 )
497498 case _ =>
498499 mapOver(tp)
Original file line number Diff line number Diff line change @@ -888,7 +888,7 @@ class Namer { typer: Typer =>
888888 * (4) If the class is sealed, it is defined in the same compilation unit as the current class
889889 */
890890 def checkedParentType (parent : untpd.Tree ): Type = {
891- val ptype = parentType(parent)(ctx.superCallContext).dealias
891+ val ptype = parentType(parent)(ctx.superCallContext).dealiasKeepAnnots
892892 if (cls.isRefinementClass) ptype
893893 else {
894894 val pt = checkClassType(ptype, parent.pos,
You can’t perform that action at this time.
0 commit comments