-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
bug: Java8 "Foo[]::new" cannot be resolved #1883
Comments
So I started to dig into it but it's actually a tricky one! IMHO the only way to get a |
What about new spoon element interface CtNewArrayReferenceExpression extends CtExecutableReferenceExpression {} which might implement derived, unsettable
Check if that idea is correct, because I am really not sure ;-) |
It's fitting if you consider that the first parameter will always be the type of the array, here |
It is fitting in my mind too, but it is not fitting from concept point of view. |
Yeah I agree that's why I don't think we should put it in the model. |
What is purpose of the return value of If A), then returning
Note: that lambda expression has one parameter, while Array.newInstance has two parameters. So if any client would like to analyze value returned by If we really want to return something there, then we should return something correct - may be new model element again? ... but that would need extra handling by client anyway ... same like WDYT? |
what about returning a singleton object |
So if I summarize it then |
Assuming a Java8
new ArrayList().stream().toArray(Foo[]::new)
The
Foo[]::new
is a CtExRefExpression which cannot be resolved withgetExecutableDeclaration
even if Foo is in the classpath.See failing test in master...monperrus:bug-execrefexpr
The text was updated successfully, but these errors were encountered: