static final fields without initializer are accepted by javac

XMLWordPrintable

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

        this code is accepted by javac:

        record Test() {
          static final int x;

          public static void main(String[] args) {
            System.out.println(x);
          }
        }

        if we change `record Test()` for `class Test` then it is rejected

        reported by Tagir in amber-dev

              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: