File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -126,11 +126,15 @@ object Inliner {
126
126
else addAccessors.transform(tree)
127
127
}
128
128
129
- /** The inline accessor definitions that need to be added to class `cls` */
129
+ /** The inline accessor definitions that need to be added to class `cls`
130
+ * As a side-effect, this method removes the `Accessed` annotations from
131
+ * the accessor symbols. So a second call of the same method will yield the empty list.
132
+ */
130
133
def accessorDefs (cls : Symbol )(implicit ctx : Context ): List [DefDef ] =
131
134
for (accessor <- cls.info.decls.filter(sym => sym.name.is(InlineGetterName ) || sym.name.is(InlineSetterName )))
132
135
yield polyDefDef(accessor.asTerm, tps => argss => {
133
136
val Annotation .Accessed (accessed) = accessor.getAnnotation(defn.AccessedAnnot ).get
137
+ accessor.removeAnnotation(defn.AccessedAnnot )
134
138
val rhs =
135
139
if (accessor.name.is(InlineSetterName ) &&
136
140
argss.nonEmpty && argss.head.nonEmpty) // defensive conditions
You can’t perform that action at this time.
0 commit comments