@@ -395,6 +395,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
395395 }
396396 }
397397
398+ /** Is `sym` a constructor of a Java-defined annotation? */
399+ def isJavaAnnotConstr (sym : Symbol ) =
400+ sym.is(JavaDefined ) && sym.isConstructor && sym.owner.derivesFrom(defn.AnnotationClass )
401+
398402 /** Match re-ordered arguments against formal parameters
399403 * @param n The position of the first parameter in formals in `methType`.
400404 */
@@ -420,7 +424,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
420424 }
421425
422426 def tryDefault (n : Int , args1 : List [Arg ]): Unit = {
423- liftFun()
427+ if ( ! isJavaAnnotConstr(methRef.symbol)) liftFun()
424428 val getter = findDefaultGetter(n + numArgs(normalizedFun))
425429 if (getter.isEmpty) missingArg(n)
426430 else {
@@ -575,11 +579,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
575579
576580 def normalizedFun = myNormalizedFun
577581
578- private def isJavaAnnotConstr (sym : Symbol ) =
579- sym.is(JavaDefined ) && sym.isConstructor && sym.owner.derivesFrom(defn.AnnotationClass )
580-
581582 override def liftFun (): Unit =
582- if (liftedDefs == null && ! isJavaAnnotConstr(methRef.symbol) ) {
583+ if (liftedDefs == null ) {
583584 liftedDefs = new mutable.ListBuffer [Tree ]
584585 myNormalizedFun = liftApp(liftedDefs, myNormalizedFun)
585586 }
@@ -610,7 +611,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
610611 val app1 =
611612 if (! success) app0.withType(UnspecifiedErrorType )
612613 else {
613- if (! sameSeq(args, orderedArgs)) {
614+ if (! sameSeq(args, orderedArgs) && ! isJavaAnnotConstr(methRef.symbol) ) {
614615 // need to lift arguments to maintain evaluation order in the
615616 // presence of argument reorderings.
616617 liftFun()
0 commit comments