IDEA-96228 (restrict annotation owner at lower language levels)

This commit is contained in:
Roman Shevchenko
2012-11-30 20:18:28 +01:00
parent 1c95e8a529
commit c0d2012934
3 changed files with 25 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
import java.util.Collection;
@interface Anno {
Anno[] nested() default {};
}
@@ -13,4 +15,12 @@ abstract class C {
void notWrong() { }
}
class B extends <error descr="Annotations are not allowed here">@Deprecated</error> Object{}
class B extends <error descr="Annotations are not allowed here">@Deprecated</error> Object { }
enum E {
@Anno E1
}
interface I {
@<error descr="Duplicate annotation">Anno</error> public @<error descr="Duplicate annotation">Anno</error> Collection<<error descr="Annotations are not allowed here">@Anno</error> String> method(@<error descr="Duplicate annotation">Anno</error> @<error descr="Duplicate annotation">Anno</error> Object o);
}