-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b120
-
Verified
javac rejects code which is supposed to be compilable
code sample:
import java.util.function.Function;
class Sample {
public <T, R> void foo(Function<R, T> f1, Function<T, R> f2, R r) {}
void m(Integer intValue) {
foo(o -> o, o -> o , intValue);
}
}
Error:
C:\\Desktop\\Sample.java:6: error: incompatible types: cannot infer
type-variable(s) T,R
foo(o -> o, o -> o , intValue);
^
(argument mismatch; bad return type in lambda expression
Object cannot be converted to Integer)
where T,R are type-variables:
T extends Object declared in method <T,R>foo(Function<R,T>,Function<T,R>,R)
R extends Object declared in method <T,R>foo(Function<R,T>,Function<T,R>,R)
1 error
- relates to
-
JDK-8178150 Regression in logic for handling inference stuck constraints
-
- Closed
-