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

Graph Inference: bad graph calculation leads to assertion error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8
    • tools
    • b82
    • Verified

    Description

      An assertion is thrown when compiling this program:

      interface Predicate<X> {
          boolean accepts(X x);
      }

      class Optional<T> {
          public boolean isPresent() { return false; }
          public static<E> Optional<E> empty() { return null; }
      }

      interface Supplier<X> {
          X make();
      }

      class FindSink<O, T> { }

      class OfRef<R> extends FindSink<R, Optional<R>> { }

      class FindOp<T, O> {
          public static<F> FindOp<F, Optional<F>> makeRef() {
              return new FindOp<>(Optional.empty(), Optional::isPresent, OfRef::new);
          }
       
          private FindOp(O emptyValue,
                         Predicate<O> presentPredicate,
                         Supplier<FindSink<T, O>> sinkSupplier) {
          }
      }


      Attachments

        Activity

          People

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: