Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error although code is correct #291

Open
fstab opened this issue Jul 5, 2017 · 2 comments
Open

Syntax error although code is correct #291

fstab opened this issue Jul 5, 2017 · 2 comments

Comments

@fstab
Copy link

fstab commented Jul 5, 2017

I don't know if this is the right place to report this, but I wanted to give Visual Studio Code a try as a Java IDE, and it reports a syntax error for code that compiles perfectly well:

                ElementMatcher.Junction<MethodDescription> junction = ElementMatchers
                        .named(method.getMethodName())
                        .and(not(isAbstract()))
                        .and(isPublic())
                        .and(takesArguments(method.getParameterTypes().size()));

It underlines the ElementMatchers at the end of the first line saying:

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 I think it could be a bug in the Java Language Server.

@fbricon
Copy link
Contributor

fbricon commented Jul 5, 2017

I can reproduce the problem with Eclipse, so this is definitely a bug in the Eclipse compiler. Can you open a bug in https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT?

@fstab
Copy link
Author

fstab commented Jul 5, 2017

I opened a bug here https://bugs.eclipse.org/bugs/show_bug.cgi?id=519256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants