Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.3
-
None
Description
For this code:
import java.lang.annotation.* import groovy.transform.TupleConstructor @Target([ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PARAMETER]) @Retention(RetentionPolicy.RUNTIME) public @interface MyAnno { } @MyAnno record Car(String make, @MyAnno String model) { } assert !Car.getAnnotation(MyAnno) assert Car.getMethod('model').getAnnotation(MyAnno) assert Car.getConstructor(String, String).getAnnotation(MyAnno) assert Car.getConstructor(String, String).getParameterAnnotations()[1][0].annotationType() == MyAnno
Groovy 4 on JDK17 currently fails with:
Annotation @MyAnno is not allowed on element RECORD_COMPONENT
So, the annotation is showing up where it shouldn't.
In addition, the annotation isn't showing up in other places where it should.
TL;DR: We have this working for some cases but not all.
Attachments
Issue Links
- links to