Skip to content

Commit f847ef6

Browse files
committed
Switch to atPhaseNoLater & push it upstream
1 parent e580aaa commit f847ef6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package dotty.tools
22
package dotc
33
package core
44

5-
import Symbols._, Types._, Contexts._, Constants._
6-
import dotty.tools.dotc.ast.tpd, tpd.*
5+
import Symbols._, Types._, Contexts._, Constants._, Phases.*
6+
import ast.tpd, tpd.*
77
import util.Spans.Span
88
import printing.{Showable, Printer}
99
import printing.Texts.Text
10-
import annotation.internal.sharable
10+
11+
import scala.annotation.internal.sharable
1112

1213
object Annotations {
1314

@@ -87,7 +88,7 @@ object Annotations {
8788
def sameAnnotation(that: Annotation)(using Context): Boolean =
8889
symbol == that.symbol && tree.sameTree(that.tree)
8990

90-
def hasOneOfMetaAnnotation(metaSyms: Symbol*)(using Context): Boolean =
91+
def hasOneOfMetaAnnotation(metaSyms: Symbol*)(using Context): Boolean = atPhaseNoLater(erasurePhase) {
9192
def recTp(tp: Type): Boolean = tp.dealiasKeepAnnots match
9293
case AnnotatedType(parent, metaAnnot) => metaSyms.exists(metaAnnot.matches) || recTp(parent)
9394
case _ => false
@@ -99,6 +100,7 @@ object Annotations {
99100
case Typed(expr, _) => rec(expr)
100101
case _ => false
101102
metaSyms.exists(symbol.hasAnnotation) || rec(tree)
103+
}
102104

103105
/** Operations for hash-consing, can be overridden */
104106
def hash: Int = System.identityHashCode(this)

compiler/src/dotty/tools/dotc/transform/Memoize.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
133133
def removeUnwantedAnnotations(denot: SymDenotation, metaAnnotSym: ClassSymbol): Unit =
134134
if (sym.annotations.nonEmpty) {
135135
val cpy = sym.copySymDenotation()
136-
cpy.filterAnnotations(annot => atPhase(typerPhase)(annot.hasOneOfMetaAnnotation(metaAnnotSym)))
136+
cpy.filterAnnotations(annot => annot.hasOneOfMetaAnnotation(metaAnnotSym))
137137
cpy.installAfter(thisPhase)
138138
}
139139

0 commit comments

Comments
 (0)