primary fields, reflection and annotations

Remi Forax forax at
Wed Dec 6 15:10:26 UTC 2017

I suppose it's a good idea to support annotations on record fields, 
  record Person(@JSONProperty String name); 
at least the current prototype support that, it considers that the target is an ElementType.FIELD and copy the annotations to the generated fields.

To access to the annotation sat runtime, you have to crawle the declared fields of the record which are private.
And those annotations are not present as parameter annotation of the primary constructor.

I think we should consider how we want to reflect on a record Class,
  Do we want a java.lang.reflect.RecordField ?
  Do we want a new annotation target RECORD_FIELD ?


More information about the amber-spec-experts mailing list