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

18.4: Improve generation of fresh variables

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u60
    • Fix Version/s: tbd_major
    • Component/s: specification
    • Labels:
      None

      Description

      This began failing with the patch from JDK-8069545.

      ---

      class C<T> {}

      <S> C<S> makeC(Function<String,S> f) { return null; }
      <T extends Comparable<T>> void eatC(C<T> list) {}

      void test() {
          eatC(makeC(x->x));
      }

      ---

      Expected: compiles, S = T = String

      Actual: error:

      error: method eatC cannot be applied to given types;
          eatC(makeC(x->x));
          ^
        required: C<T>
        found: C<Object>
        reason: inferred type does not conform to upper bound(s)
          inferred: Object
          upper bound(s): Comparable<Object>,Object

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dlsmith Dan Smith
                Reporter:
                dlsmith Dan Smith
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: