-
Notifications
You must be signed in to change notification settings - Fork 95
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
Methods that return Lambdas Problem #19
Comments
Hi mortdiggiddy! :) So short story first: The long version: I can tell you how java passes the modifier In the default use-case of methods, arguments that are passed to a method are in following order: But if you use variables from the outside in a lambda function, Java passes them into the lambda expression by automatically inserting them as arguments behind "this". The old TypeResolver did not considered that new feature of Java 8. I hope I could describe a little bit the background story. So basically in your second code example you don't pass any variables into the lambda expression. That's why it is working. |
@mortdiggiddy Try the latest release, 0.4.5. This should work as expected in the latest release. Feel free to re-open if this is not the case. Also see the test I added based on your example: |
Good work. |
Hello,
Great work, truly great.
I noticed a problem when I tried to use this library for the first time. Consider the following code:
Produces console ouput:
class java.lang.Integer
This is wrong, it should produce
class java.lang.reflect.Method
. I noticed that nested way deep in the code ofpopulateLambdaArgs(...)
that it does indeed find a TypeVariable of java.lang.reflect.Method. However this fails the test at the end of the method:When the main() method is changed above to this:
Everything works.
class java.lang.reflect.Method
The text was updated successfully, but these errors were encountered: