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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • None
    • tools
    • b28

      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.

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

              Created:
              Updated:
              Resolved: