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

javac erroneously allows "final" in front of a record pattern

    XMLWordPrintable

Details

    • b20

    Backports

      Description

        https://mail.openjdk.org/pipermail/amber-dev/2023-September/008302.html

        record Foo ( int x) {}

        public static void main ( String [] args ) {
          Object o = args ;
          switch ( o ) {
            case final Foo( int x) -> {} // oops !
            default -> {}
          }
        }

        Attachments

          Issue Links

            Activity

              People

                abimpoudis Angelos Bimpoudis
                abimpoudis Angelos Bimpoudis
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: