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

javac, assertion error while accessing a member of a wildcard site during overload resolution

XMLWordPrintable

      This code:

      class ExceptionInferenceBug {

          interface PartialFunction<T, V> {
              V apply(T paramT);
          }

          interface Function<T, V> extends PartialFunction<T, V> {
              V apply(T paramT);
          }

          class O {}

          static <T, V> void run(Function<? super O, V> function) {}
          static <T, V> void run(PartialFunction<? super O, V> function) {}

          public static void main(String[] args) {
              run(t -> t.toString());
          }
      }

      makes javac generate an assertion error. If the second run method is commented out there is no error.

      reported in lambda-dev list: http://mail.openjdk.java.net/pipermail/lambda-dev/2014-February/011910.html

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

              Created:
              Updated:
              Resolved: