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

[lworld] spurious javac error for 'this' expression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • repo-valhalla
    • repo-valhalla
    • tools

    Description

      javac generates the same error message twice for this code:

      value class C {
          int i;
          C() {
              m(this);
              i = 0;
          }

          void m(C c) {}
      }

      although with a slightly different position:

      ValhallaTest1.java:4: error: value class instance should not be passed around before being fully initialized
              m(this);
                ^
      ValhallaTest1.java:4: error: value class instance should not be passed around before being fully initialized
              m(this);
               ^
      2 errors

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: