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

[lworld] javac should allow reading strict fields before the super invocation

XMLWordPrintable

      the code below should be accepted according to the current text of JEP 401, in particular where it reads:
      ...
      For convenience, fields that have been assigned may be read by subsequent early construction code (that is, early construction may freely access the fields of this, but may not invoke instance methods
      ...

      value class V1 {
          int x;
          int y;

          V1() {
              x = 34;
              y = x;
          }
      }

      javac is currently rejecting it

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

              Created:
              Updated: