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

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

    XMLWordPrintable

Details

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

    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

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

              Dates

                Created:
                Updated:
                Resolved: