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

[lworld] javac allows super constructor invocations before all fields have been initialized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • tools

      this code is being accepted by javac:

      value class V {
          int i;

          V() {
              super();
              i = 1;
          }
      }

      it should be rejected. Also, with value records, the implicit super call always ends up before the field stores. Reported by Tobias

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: