Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234101

Compilation error thrown when repeating annotation is used on record component

XMLWordPrintable

    • b27

        The below code tries to use repeating annotation on record component and should compile successfully. However, it leads to a compilation error.

        import java.lang.annotation.Target;
        import java.lang.annotation.ElementType;
        import java.lang.annotation.Repeatable;

        @Target({ElementType.PARAMETER}) @interface ParameterLessContainer{ParameterLess[] value();}
        @Repeatable(ParameterLessContainer.class)
        @Target({ElementType.PARAMETER}) @interface ParameterLess {}

        record R(@ParameterLess() @ParameterLess() int i) {
        }

              vromero Vicente Arturo Romero Zaldivar
              vkhatri Vinod Khatri
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: