langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 21704 e215a6216604
parent 21498 58c2486db8d0
child 21712 d363f367d4c0
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Nov 01 19:08:56 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Nov 01 21:43:27 2013 +0100
@@ -2254,7 +2254,8 @@
         // empty annotations, if only declaration annotations were given.
         // This method will raise an error for such a type.
         for (JCAnnotation ai : annotations) {
-            if (typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
+            if (!ai.type.isErroneous() &&
+                typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
                 log.error(ai.pos(), "annotation.type.not.applicable");
             }
         }