@@ -62,7 +62,7 @@ object Checking {
6262 /** Check info `tp` for cycles. Throw CyclicReference for illegal cycles,
6363 * break direct cycle with a LazyRef for legal, F-bounded cycles.
6464 */
65- def checkInfo (tp : Type ): Type = tp match {
65+ def checkInfo (tp : Type ): Type = tp.stripAnnots match {
6666 case tp @ TypeAlias (alias) =>
6767 try tp.derivedTypeAlias(apply(alias))
6868 finally {
@@ -102,7 +102,7 @@ object Checking {
102102 // to symbol `sym` itself. We only check references with interesting
103103 // prefixes for cycles. This pruning is done in order not to force
104104 // global symbols when doing the cyclicity check.
105- def isInteresting (prefix : Type ): Boolean = prefix.stripTypeVar match {
105+ def isInteresting (prefix : Type ): Boolean = prefix.stripTypeVar.stripAnnots match {
106106 case NoPrefix => true
107107 case prefix : ThisType => sym.owner.isClass && prefix.cls.isContainedIn(sym.owner)
108108 case prefix : NamedType => ! prefix.symbol.isStaticOwner && isInteresting(prefix.prefix)
@@ -246,7 +246,7 @@ trait Checking {
246246 * @return `tp` itself if it is a class or trait ref, ObjectClass.typeRef if not.
247247 */
248248 def checkClassTypeWithStablePrefix (tp : Type , pos : Position , traitReq : Boolean )(implicit ctx : Context ): Type =
249- tp.underlyingClassRef(refinementOK = false ) match {
249+ tp.underlyingClassRef(refinementOK = false ).stripAnnots match {
250250 case tref : TypeRef =>
251251 if (ctx.phase <= ctx.refchecksPhase) checkStable(tref.prefix, pos)
252252 if (traitReq && ! (tref.symbol is Trait )) ctx.error(d " $tref is not a trait " , pos)
@@ -270,7 +270,7 @@ trait Checking {
270270 * their lower bound conforms to their upper cound. If a type argument is
271271 * infeasible, issue and error and continue with upper bound.
272272 */
273- def checkFeasible (tp : Type , pos : Position , where : => String = " " )(implicit ctx : Context ): Type = tp match {
273+ def checkFeasible (tp : Type , pos : Position , where : => String = " " )(implicit ctx : Context ): Type = tp.stripAnnots match {
274274 case tp : RefinedType =>
275275 tp.derivedRefinedType(tp.parent, tp.refinedName, checkFeasible(tp.refinedInfo, pos, where))
276276 case tp @ TypeBounds (lo, hi) if ! (lo <:< hi) =>
@@ -310,7 +310,7 @@ trait Checking {
310310 }
311311
312312 cls.info.decls.foreach(checkDecl)
313- cls.info match {
313+ cls.info.stripAnnots match {
314314 case ClassInfo (_, _, _, _, selfSym : Symbol ) => checkDecl(selfSym)
315315 case _ =>
316316 }
0 commit comments