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

javac should reject records with @SafeVarargs applied to varargs record component

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Understanding:
      Cause Known

      Description

      this code:

      record R (@SafeVarargs String... s) {}

      is accepted by the compiler when it shouldn't according to the spec, the annotation would be applicable to the accessor but the generated accessor won't have any varargs argument, no arguments at all actually.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vromero Vicente Arturo Romero Zaldivar
                Reporter:
                vromero Vicente Arturo Romero Zaldivar
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: