Skip to content

Commit 579dd1d

Browse files
committed
Don't lift arguments out of Java annotation constructors
Lifting such arguments breaks the contract with the backend, which expects to see default getters inline, not lifted out.
1 parent 4b6e15c commit 579dd1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,11 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
575575

576576
def normalizedFun = myNormalizedFun
577577

578+
private def isJavaAnnotConstr(sym: Symbol) =
579+
sym.is(JavaDefined) && sym.isConstructor && sym.owner.derivesFrom(defn.AnnotationClass)
580+
578581
override def liftFun(): Unit =
579-
if (liftedDefs == null) {
582+
if (liftedDefs == null && !isJavaAnnotConstr(methRef.symbol)) {
580583
liftedDefs = new mutable.ListBuffer[Tree]
581584
myNormalizedFun = liftApp(liftedDefs, myNormalizedFun)
582585
}

0 commit comments

Comments
 (0)