-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
8u40
-
x86_64
-
linux_ubuntu
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
A DESCRIPTION OF THE PROBLEM :
The following works with 1.8.0_11 and the Eclipse Java compiler:
public class Bug {
public static void main(String[] args) {
foo(bar(true, b -> b ? 1 : 0));
}
public static void foo(int... baz) { }
public static <R, A> R bar(A arg, java.util.function.Function<A, R> f) {
return f.apply(arg);
}
}
1.8.0_40 error message:
Bug.java:3: error: incompatible types: inferred type does not conform to upper bound(s)
foo(bar(true, b -> b ? 1 : 0));
^
inferred: Integer
upper bound(s): int[],Object
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
REGRESSION. Last worked in version 8u11
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
A DESCRIPTION OF THE PROBLEM :
The following works with 1.8.0_11 and the Eclipse Java compiler:
public class Bug {
public static void main(String[] args) {
foo(bar(true, b -> b ? 1 : 0));
}
public static void foo(int... baz) { }
public static <R, A> R bar(A arg, java.util.function.Function<A, R> f) {
return f.apply(arg);
}
}
1.8.0_40 error message:
Bug.java:3: error: incompatible types: inferred type does not conform to upper bound(s)
foo(bar(true, b -> b ? 1 : 0));
^
inferred: Integer
upper bound(s): int[],Object
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
REGRESSION. Last worked in version 8u11
REPRODUCIBILITY :
This bug can be reproduced always.
- relates to
-
JDK-8033483 Should ignore nested lambda bodies during overload resolution
-
- Closed
-