Details
-
Bug
-
Resolution: Fixed
-
P3
-
8, 8-repo-lambda
-
b108
-
Verified
Description
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).
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).
Attachments
Issue Links
- relates to
-
JDK-8024154 Fix for 8016177: structural most specific and stuckness breaks 6 langtools tests
- Closed
-
JDK-8016201 Lambda Spec: Refine treatment of overloaded methods with mixed lambda parameter types
- Closed
-
JDK-8016178 Order of unsticking functional expressions
- Closed