@@ -108,27 +108,19 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
108
108
if (sym.isGetter) sym.info.resultType
109
109
else /* sym.isSetter*/ sym.info.firstParamTypes.head
110
110
111
- newSymbol(
111
+ val fieldSym = newSymbol(
112
112
owner = ctx.owner,
113
113
name = sym.name.asTermName.fieldName,
114
114
flags = Private | (if (sym.is(StableRealizable )) EmptyFlags else Mutable ),
115
115
info = fieldType,
116
116
coord = tree.span
117
- ).withAnnotationsCarrying(sym, defn.FieldMetaAnnot )
118
- .enteredAfter(thisPhase)
119
- }
120
-
121
- def addAnnotations (denot : Denotation ): Unit =
122
- denot match {
123
- case fieldDenot : SymDenotation if sym.annotations.nonEmpty =>
124
- val cpy = fieldDenot.copySymDenotation()
125
- cpy.annotations = atPhase(typerPhase)(sym.annotations.filterConserve { annot =>
126
- annot.hasOneOfMetaAnnotation(defn.FieldMetaAnnot )
127
- || ! annot.hasOneOfMetaAnnotation(defn.ExtFieldAccessorMetaAnnots .toList* )
128
- })
129
- cpy.installAfter(thisPhase)
130
- case _ => ()
117
+ )
118
+ fieldSym.annotations = sym.annotations.filterConserve { annot =>
119
+ annot.hasOneOfMetaAnnotation(defn.FieldMetaAnnot )
120
+ || ! annot.hasOneOfMetaAnnotation(defn.ExtFieldAccessorMetaAnnots .toList* )
131
121
}
122
+ fieldSym.enteredAfter(thisPhase)
123
+ }
132
124
133
125
def removeUnwantedAnnotations (denot : SymDenotation , metaAnnotSym : ClassSymbol ): Unit =
134
126
if (sym.annotations.nonEmpty) {
@@ -186,7 +178,6 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
186
178
if isErasableBottomField(field, rhsClass) then erasedBottomTree(rhsClass)
187
179
else transformFollowingDeep(ref(field))(using ctx.withOwner(sym))
188
180
val getterDef = cpy.DefDef (tree)(rhs = getterRhs)
189
- addAnnotations(fieldDef.denot)
190
181
removeUnwantedAnnotations(sym, defn.GetterMetaAnnot )
191
182
Thicket (fieldDef, getterDef)
192
183
else if sym.isSetter then
0 commit comments