-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Method call resolution fails with UnsolvedSymbolException
if passed parameter is a list of two or more elements
#3183
Comments
I believe that this is a mix of an inference bug + maybe other bug (after a little analysis). List<MethodCallExpr> metCallExprs = cu.findAll(MethodCallExpr.class);
metCallExprs.forEach(metCallExpr -> {
if (metCallExpr.getNameAsString().equals("asList")) {
ResolvedType resolvedType = metCallExpr.calculateResolvedType();
System.out.println(resolvedType.describe());
}
}); The solved type is calculated as |
Yes I think the bug is in |
Yes as I remember correctly, the problem is exclusively when it tries to solve the usage of a |
This issue is corrected in the current snapshot release. |
I'm using Javaparser
3.18.0
.The file to parse
src/test/resources/MyClass.java
:The parser (in Kotlin):
In the attempt to resolve the method call it fails:
But if in parsed file list consists of a single element:
Files.write(null, Arrays.asList("", ""));
->Files.write(null, Arrays.asList(""));
it is solved correctly.
The text was updated successfully, but these errors were encountered: