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

Graph inference: missing incorporation step causes spurious inference error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8, 8-repo-lambda
    • tools
    • b84
    • Verified

    Description

      This code doesn't compile:

      class TestJ8 {

          interface Func<A, B> {
              B f(A a);
          }

          class List<X> {

              <M> List<M> map(Func<X, M> f) {
                  return null;
              }

              <A> List<A> apply(final List<Func<X, A>> lf) {
                  return null;
              }

              <B, C> List<C> bind(final List<B> lb, final Func<X, Func<B, C>> f) {
                  return lb.apply(map(f)); // fails to compile
              }

          }

      }


      M is inferred as Object, which causes a spurious inference error.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: