@@ -394,6 +394,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
394394 }
395395 }
396396
397+ /** Is `sym` a constructor of a Java-defined annotation? */
398+ def isJavaAnnotConstr (sym : Symbol ) =
399+ sym.is(JavaDefined ) && sym.isConstructor && sym.owner.derivesFrom(defn.AnnotationClass )
400+
397401 /** Match re-ordered arguments against formal parameters
398402 * @param n The position of the first parameter in formals in `methType`.
399403 */
@@ -419,7 +423,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
419423 }
420424
421425 def tryDefault (n : Int , args1 : List [Arg ]): Unit = {
422- liftFun()
426+ if ( ! isJavaAnnotConstr(methRef.symbol)) liftFun()
423427 val getter = findDefaultGetter(n + numArgs(normalizedFun))
424428 if (getter.isEmpty) missingArg(n)
425429 else {
@@ -571,11 +575,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
571575
572576 def normalizedFun = myNormalizedFun
573577
574- private def isJavaAnnotConstr (sym : Symbol ) =
575- sym.is(JavaDefined ) && sym.isConstructor && sym.owner.derivesFrom(defn.AnnotationClass )
576-
577578 override def liftFun (): Unit =
578- if (liftedDefs == null && ! isJavaAnnotConstr(methRef.symbol) ) {
579+ if (liftedDefs == null ) {
579580 liftedDefs = new mutable.ListBuffer [Tree ]
580581 myNormalizedFun = liftApp(liftedDefs, myNormalizedFun)
581582 }
@@ -606,7 +607,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
606607 val app1 =
607608 if (! success) app0.withType(UnspecifiedErrorType )
608609 else {
609- if (! sameSeq(args, orderedArgs)) {
610+ if (! sameSeq(args, orderedArgs) && ! isJavaAnnotConstr(methRef.symbol) ) {
610611 // need to lift arguments to maintain evaluation order in the
611612 // presence of argument reorderings.
612613 liftFun()
0 commit comments