This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Class body of annotation class is not correctly parsed #182
Open
Assignees
Description
Description
In the class body of an annotation class, parameters are not parsed as a method/field/parameter declaration as it should be. This results in scope errors like mistaking wildcard generic parameter as ternary conditional operator.
import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.METHOD }) @Documented public @interface EventListener { Class<?>[] events() default {}; int order() default Integer.MAX_VALUE; boolean async() default false; String condition() default ""; } class A { Class<?>[] events() { } int order() { } boolean async() { } String condition() { } }
Expected behavior: [What you expect to happen]
Both events should be parsed as some kind of declaration. But it is actually parsed as "method-call" in annotation, along with other errors like "?".
Versions
Activity
Metadata
Metadata
Assignees
Labels
No labels