@@ -395,6 +395,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
395
395
}
396
396
}
397
397
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
+
398
402
/** Match re-ordered arguments against formal parameters
399
403
* @param n The position of the first parameter in formals in `methType`.
400
404
*/
@@ -420,7 +424,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
420
424
}
421
425
422
426
def tryDefault (n : Int , args1 : List [Arg ]): Unit = {
423
- liftFun()
427
+ if ( ! isJavaAnnotConstr(methRef.symbol)) liftFun()
424
428
val getter = findDefaultGetter(n + numArgs(normalizedFun))
425
429
if (getter.isEmpty) missingArg(n)
426
430
else {
@@ -575,11 +579,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
575
579
576
580
def normalizedFun = myNormalizedFun
577
581
578
- private def isJavaAnnotConstr (sym : Symbol ) =
579
- sym.is(JavaDefined ) && sym.isConstructor && sym.owner.derivesFrom(defn.AnnotationClass )
580
-
581
582
override def liftFun (): Unit =
582
- if (liftedDefs == null && ! isJavaAnnotConstr(methRef.symbol) ) {
583
+ if (liftedDefs == null ) {
583
584
liftedDefs = new mutable.ListBuffer [Tree ]
584
585
myNormalizedFun = liftApp(liftedDefs, myNormalizedFun)
585
586
}
@@ -610,7 +611,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
610
611
val app1 =
611
612
if (! success) app0.withType(UnspecifiedErrorType )
612
613
else {
613
- if (! sameSeq(args, orderedArgs)) {
614
+ if (! sameSeq(args, orderedArgs) && ! isJavaAnnotConstr(methRef.symbol) ) {
614
615
// need to lift arguments to maintain evaluation order in the
615
616
// presence of argument reorderings.
616
617
liftFun()
0 commit comments