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

source ordering bug with static type imports

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • tools
    • None

      Compiling the following program with javac 9-ea+149 succeeds or fails depending on the order the sources are compiled in.

      === p/A.java ===
      package p;
      class A extends B implements S {}
      === p/B.java ===
      package p;
      import static p.A.I;
      class B extends I {}
      === p/S.java ===
      package p;
      interface S {
        class I {}
      }
      ===

      $ javac p/B.java p/A.java p/S.java
      ... ok
      $ javac p/A.java p/B.java p/S.java
      p/B.java:3: error: cannot find symbol
      class B extends I {}
                      ^
        symbol: class I
      1 error

            jlahoda Jan Lahoda
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: