local records shouldn't capture any non-static state from any enclosing type

XMLWordPrintable

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

        test cases, provided by Tagir:

        class X {
          public static void main(String[] args) {
            int x = 2;
            record Y() {
              void test() {
                System.out.println(x);
              }
            }
            new Y().test();
          }
        }

        class X {
          public static void main(String[] args) {
            int x = 2;
            record Y() {
              static final int y = x;
            }
            new Y();
          }
        }

          1. 8236005
            2 kB
            Vicente Arturo Romero Zaldivar

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

                Created:
                Updated:
                Resolved: