Details
-
Bug
-
Resolution: Fixed
-
P3
-
8u20, 8u40
-
b32
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085401 | emb-9 | Maurizio Cimadamore | P3 | Resolved | Fixed | team |
JDK-8087009 | 8u65 | Maurizio Cimadamore | P3 | Resolved | Fixed | b01 |
JDK-8081020 | 8u60 | Maurizio Cimadamore | P3 | Resolved | Fixed | b18 |
JDK-8138430 | emb-8u65 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8086229 | emb-8u60 | Maurizio Cimadamore | P3 | Resolved | Fixed | team |
Description
---
public class FirstNonNull {
public static class C<T> {}
public static <T> T firstNonNull(T first, T second) {
return first != null ? first : second;
}
public static C<String> doesNotCompile = firstNonNull(new C<String>(), new C<>());
}
---
Error:
public static C<String> doesNotCompile = firstNonNull(new C<String>(), new C<>());
^
inferred: C<? extends Object>
upper bound(s): C<String>,Object
---
This is a regression -- it compiles correctly with the initial release of JDK 8.
Reported on Stack Overflow: http://stackoverflow.com/questions/25490581
Attachments
Issue Links
- backported by
-
JDK-8081020 Inference failure with nested invocation
- Resolved
-
JDK-8085401 Inference failure with nested invocation
- Resolved
-
JDK-8086229 Inference failure with nested invocation
- Resolved
-
JDK-8087009 Inference failure with nested invocation
- Resolved
-
JDK-8138430 Inference failure with nested invocation
- Resolved
- duplicates
-
JDK-8080645 Inference failure with multiple nested invocations
- Resolved
- relates to
-
JDK-8056092 18.5.2: Do not eagerly resolve when inference variables are in lower bounds
- Open
-
JDK-8030741 Inference: implement eager resolution of return types, consistent with JDK-8028800
- Closed