This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The following code shows error in the IDE, while it compiles fine with javac: public class ShowsCompileProblem<T extends java.util.List<? extends T> & java.util.RandomAccess> { } The reported error has the following message: Error types java.util.List<? extends T> and java.util.List<? extends T> are incompatible; both define iterator(), but with unrelated return types ShowsCompileProblem.java 1
Created attachment 65066 [details] The problematic source
A simpler test file (the problem is independent from the order of the classes after extends): public class ShowsCompileProblem<T extends java.util.List<?> & java.io.Serializable> { }
This is also reproducible with the latest nightly. (200808010201)
Still reproducible with the latest nightly (200810181401): File: public class Issue140911<T extends java.util.List<?> & java.io.Serializable> { } Error report: Error types java.util.List<?> and java.util.List<?> are incompatible; both define iterator(), but with unrelated return types Issue140911.java 1 (I am not sure whether this is a compiler bug, or it has only representational problem. I leave this in the javac modul. If you think this is a wrong place, please move this somewhere else place. Thanks.)
The problem is & in generics, the compilation should be fine, there is only problem with incorrect error mark
Overtake.
This works form me in latest (dev) build.