Community
Participate
Working Groups
The following sample code compiles using javac 1.8.0_45 but results in "Type mismatch" in Eclipse Neon 4.6 (org.eclipse.jdt.core_3.12.0.v20160516-2131.jar). import java.util.HashMap; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; public class EclipseBug { public static void main(String[] args) { // Fails with "Type mismatch: cannot convert from CompletableFuture<Object> to CompletableFuture<Map<String,String>>" CompletableFuture<Map<String, String>> future = someMethod().thenApply(map -> map.entrySet() .stream() .collect(Collectors.toMap(e -> transformKey(e.getKey()), e -> e.getValue()))); } public static CompletableFuture<Map<Integer, String>> someMethod() { // Implementation not important return CompletableFuture.supplyAsync(HashMap::new); } public static String transformKey(Integer value) { // Implementation not important return value + "suffix"; } }
I see this compiles fine as of latest I build. I will dig out which bug addressed this.
Works for me in JDT 3.18.100.v20190916-1045 ; tried ecj 1.8, 12. Mark fixed?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.