structural most specific and stuckness

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8, 8-repo-lambda
    • Component/s: tools
    • b108
    • Verified

      Code like the following:

      static <T,R> Stream<R> map(Stream<T> s, Function<T,R> f);
      static <T> IntStream map(Stream<T> s, ToIntFunction<T> f);
      Stream<String> ss = ...;
      map(ss, s->s.length());

      Doesn't work, as the lambda is 'stuck' during overload resolution, which means both methods will be applicable. In turn, for structural most specific to kick in, we need same parameter types on corresponding functional descriptors, which is not the case here (alpha-renaming).

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: