Re: findVirtual problem

2009-08-19 Thread Christian Thalinger
John Rose wrote: On Aug 18, 2009, at 6:07 AM, Raffaello Giulietti wrote: Hi Christian, do an upcast String result = mh.Stringinvoke((Object) foo); Yes. The difference between the two call sites is: (Ljava/lang/String;)Ljava/lang/String; vs.

findVirtual problem

2009-08-18 Thread Christian Thalinger
Hi! Looks like there is a problem with findVirtual. Since I don't know very much about the MethodHandle Java level, I want to be sure it's not my fault. Doing: MethodHandle mh = MethodHandles.lookup().findVirtual(Object.class, toString, MethodType.make(String.class)); String result =

Re: findVirtual problem

2009-08-18 Thread Attila Szegedi
Shouldn't that be mh.String,Objectinvoke(foo) ? It returns a String and takes an Object. Attila. On 2009.08.18., at 10:55, Christian Thalinger wrote: MethodHandle mh = MethodHandles.lookup().findVirtual(Object.class, toString, MethodType.make(String.class)); String result =

Re: findVirtual problem

2009-08-18 Thread Christian Thalinger
Attila Szegedi wrote: Shouldn't that be mh.String,Objectinvoke(foo) ? It returns a String and takes an Object. No, the syntax is correct. A MethodHandle invoke only specifies the return type. -- Christian ___ mlvm-dev mailing list

Re: findVirtual problem

2009-08-18 Thread Raffaello Giulietti
Christian Thalinger wrote: Attila Szegedi wrote: Shouldn't that be mh.String,Objectinvoke(foo) ? It returns a String and takes an Object. No, the syntax is correct. A MethodHandle invoke only specifies the return type. -- Christian ___

Re: findVirtual problem

2009-08-18 Thread John Rose
On Aug 18, 2009, at 6:07 AM, Raffaello Giulietti wrote: Hi Christian, do an upcast String result = mh.Stringinvoke((Object) foo); Yes. The difference between the two call sites is: (Ljava/lang/String;)Ljava/lang/String; vs. (Ljava/lang/Object;)Ljava/lang/String; The actual (erased)