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 {
126126 else addAccessors.transform(tree)
127127 }
128128
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+ */
130133 def accessorDefs (cls : Symbol )(implicit ctx : Context ): List [DefDef ] =
131134 for (accessor <- cls.info.decls.filter(sym => sym.name.is(InlineGetterName ) || sym.name.is(InlineSetterName )))
132135 yield polyDefDef(accessor.asTerm, tps => argss => {
133136 val Annotation .Accessed (accessed) = accessor.getAnnotation(defn.AccessedAnnot ).get
137+ accessor.removeAnnotation(defn.AccessedAnnot )
134138 val rhs =
135139 if (accessor.name.is(InlineSetterName ) &&
136140 argss.nonEmpty && argss.head.nonEmpty) // defensive conditions
You can’t perform that action at this time.
0 commit comments