ClassWriter: Position UNKNOWN in type annotation

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8
    • Component/s: tools

      My colleague Chris Povirk noticed that for the following input, javac logs a warning to stderr and omits the type annotations from the output.

      The issue is similar to the one discussed in this compiler-dev thread:
      http://mail.openjdk.java.net/pipermail/type-annotations-dev/2013-April/000777.html

      ```
      import static java.lang.annotation.ElementType.TYPE_USE;

      import java.lang.annotation.Target;

      @Target(TYPE_USE)
      @interface Anno {}

      class Lib<T> {}

      class PositionUnknown {
        Object foo() {
          return new Lib<@Anno ?>[0];
        }
      }
      ```

      ```
      $ javac -fullversion T.java
      javac full version "14-ea+22-982"
      ClassWriter: Position UNKNOWN in type annotation: @Anno
      ClassWriter: Position UNKNOWN in type annotation: @Anno
      ```

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: