| Summary: | [1.8][compiler] Bogus error about incompatible return type during override | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mathieu Croizard <mcr> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, srikanth_sankaran, stephan.herrmann |
| Version: | 4.3.1 | ||
| Target Milestone: | BETA J8 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Thanks, will take a look. Not reproducible in junit, but is reproducible in IDE. Interesting. Under investigation. Actually, even in IDE, clean + build does not show the problem, while incremental build does. Mathieu - Thank you ! This is such a nasty bug that is truly worth getting rid of before GA. Basically, there was a race condition in the type system abstraction as a result of which we end up with two java.util.List's - you can imagine the resultant chaos from there on. Stephan, I wonder if the problems we saw with the compiler complaining about identical types not being compatible go away with this patch or if that is some other beast altogether. Fix is simple. Rearrange a couple of lines of code to prevent the race and ensure identity of types. Fix and tests here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=0174bc81f7d2de8d27eebb7df04fb04a776d1f62 Verified for Java 8 RC1 using Kepler SR2 + Eclipse Java Development Tools Patch for Java 8 Support (BETA) 1.0.0.v20140220-2054 |
Hello, I have an error from the compiler while compiling this code: K1.java : import java.util.List; import java.util.Map; public interface K1 { public Map<String,List> get(); } K.java import java.util.List; import java.util.Map; public class K implements K1 { @Override public Map<String, List> get() { return null; } } "The return type is incompatible with K1.get()" Why do i have this error, as the signature are the same? When i put List<?> in both the interface and the class, this work properly. Is the wildcard mandatory? I am using 1.0.0.v20140213-0104_BETA_JAVA8 Eclipse Java Development Tools Patch for Java 8 Support (BETA), Eclipse Plugin-in Development Environment Patch for Java 8 Support (BETA), Eclipse RCP Patch for Java 8 Support (BETA) Thanks!