Skip to content

Commit 56a1cbc

Browse files
committed
Factor out common behavior for target name annotations
1 parent f3b5903 commit 56a1cbc

File tree

3 files changed

+249
-244
lines changed

3 files changed

+249
-244
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ class SuperAccessors(thisPhase: DenotTransformer) {
8787
val acc = newSymbol(
8888
clazz, superName, Artifact | Method | maybeDeferred,
8989
superInfo, coord = accRange).enteredAfter(thisPhase)
90-
if sym.hasAnnotation(defn.TargetNameAnnot) then
91-
acc.addAnnotation(
92-
Annotation(defn.TargetNameAnnot,
93-
Literal(Constant(superAccessorName(sym.erasedName).toString)).withSpan(sym.span)))
90+
acc.deriveTargetNameAnnotation(sym, superAccessorName)
9491
// Diagnostic for SI-7091
9592
if (!accDefs.contains(clazz))
9693
report.error(

0 commit comments

Comments
 (0)