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

No compilation error reported when record is declared in an inner class

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools

      Description

      The below code should throw a compilation error as record is declared in an inner class. However, the compilation goes through successfully.

      class Outer {
                      class Inner {
                                      record R(int a) {}
                      }
      }

      class RecordsTest {

                      public static void main(String[] args) {
                                      Outer.Inner.R rec = new Outer.Inner.R(1);
                                      System.out.println(rec.a());
                      }
      }

        Attachments

          Activity

            People

            • Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              vkhatri Vinod Khatri
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: