-
Notifications
You must be signed in to change notification settings - Fork 93
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
TypeResolver.resolveRawArgument returns java.lang.Object instead of actual type ? #14
Comments
I forgot to say that I'm using the following java version: java -version java version "1.8.0_66" |
errata, (oops sorry): for the following example: Printer<String> printer = new Printer<>();
Consumer<String> print = printer::println;
Class<?> type = TypeResolver.resolveRawArgument(Consumer.class, print.getClass());
System.out.println(type); I would expect the type to be "java.lang.String" instead of "Java.lang.Object". thanks |
This seems to be similar to my #16? I would explain this here that the object |
The short answer is that this use case does not appear to be supported by the technique we're using to resolve lambda type information. The reason is, with:
The argument for println is defined as
The difference is here the value of T is explicitly defined on the System.out.println method definition as a String rather than as |
Hi, I am facing this issue.
work around is
|
Hi @yaitskov, What's interesting about your scenario is that this works:
But this doesn't:
For whatever reason the |
Hi;
I'm having (for example) the following interface:
Now, let's define a method reference on the "print" method, and using an instance of the Printer class:
so, above, I would expect to get a Printer type instead of Object ?
Notice that the following similar example is working fine:
Am I missing something ?
thanks in advance;
/Pierre
The text was updated successfully, but these errors were encountered: