Community
Participate
Working Groups
I originally reported this bug here https://github.com/eclipse/eclipse.jdt.ls/issues/291, and was asked to open an upstream bug for the Eclipse compiler: The following code yields a syntax error although the code is correct: ElementMatcher.Junction<MethodDescription> junction = ElementMatchers .named(method.getMethodName()) .and(not(isAbstract())) .and(isPublic()) .and(takesArguments(method.getParameterTypes().size())); The error reported in the first line of the snippet is: file: 'file:///Users/fabian/workspace/promagent/promagent-internal/src/main/java/io/promagent/internal/Promagent.java' severity: 'Error' message: 'Type mismatch: cannot convert from ElementMatcher.Junction<MethodDescription & NamedElement & ModifierReviewable.OfAbstraction> to ElementMatcher.Junction<MethodDescription>' at: '83,71' source: 'Java' The code can be found in commit 8a6655e3e4d034193634d51025baca1ca079a72f here: https://github.com/fstab/promagent/blob/master/promagent-internal/src/main/java/io/promagent/internal/Promagent.java#L83-L87 The code looks fine in Intellij, compiles without problems with Maven, and runs well, so it's probably a bug in the Eclipse compiler.
Bug can be reproduced in Eclipse Oxygen
Type compatibility involving intersection types is not a trivial thing. Will analyze which compiler is right or wrong after Java 9 has sailed.
bulk move out of 4.8
Bulk move out of 4.9
I'd be willing to make a quick investigation if s.o. would provide a self-contained example.
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.