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

[lworld] javac should issue an error if a strict instance field has not been initialized before the super invocation

XMLWordPrintable

      javac should issue an error for code like:

      import jdk.internal.vm.annotation.NullRestricted;
      import jdk.internal.vm.annotation.Strict;

      class StrictNR {
          static value class IValue {
              int i = 0;
          }

          @Strict
          @NullRestricted
          IValue val;// = new IValue(); // no initialization

          public static void main(String[] args) {
              StrictNR s = new StrictNR();
          }
      }

      as this code won't pass the verifier check

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

              Created:
              Updated:
              Resolved: