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

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

XMLWordPrintable

    • b20

        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 -> {}
          }
        }

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

                Created:
                Updated:
                Resolved: