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

XMLWordPrintable

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

      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());
                      }
      }

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Vinod Khatri
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: