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

Incorrect forward reference diagnostic for local variable initializer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.3.0
    • 1.3.0
    • tools
    • rc2
    • sparc
    • solaris_7

      During compile the following simple code

      class test {
          public static void main (String [] args) {
              int i = (i = 10) + i++;
              int n = (n = 0);
          }
      }

      I've got the error message:

      <cos@ultrasparrow: ~/temp(318)> /usr/java1.3/bin/javac -server test.java
      test.java:3: illegal forward reference
              int i = (i = 10) + i++;
                                 ^
      1 error

      With Java1.2 it has been compiled pretty fine.

            wmaddoxsunw William Maddox (Inactive)
            kboudniksunw Konstantin Boudnik (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: