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

[lworld] instance field initializers should be executed immediately upon entry to a non-this-calling constructor

XMLWordPrintable

      for code like:

      value class V {
          int i = 1;
          int y;

          V() {
              y = 2;
          }
      }

      javac is generating the constructor as:

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

      it should be:

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

            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: