Type annotation on record component doesn't seem to be supported by javac ?

Remi Forax forax at univ-mlv.fr
Tue Oct 8 21:54:00 UTC 2019


Hi all,
with a type annnotation on a record component defined like this
  
  @Target(ElementType.TYPE_PARAMETER)
  @Retention(RetentionPolicy.RUNTIME)
  public @interface TypeAnn { }

I get:
  ./src/main/java/fr.umlv.record/jdk14/AllStructures.java:11: error: annotation type not applicable to this kind of declaration
    record RecordSubType(@Ann int component1, @TypeAnn String component2) {

Note: i'm using jdk 14-amber+0-df2722d9f9d0, i will test with the current source asap.

regards,
Rémi


More information about the amber-dev mailing list