Hi all

So I've been playing around with invokedynamic (with build 84),
however I've stumbled on something I find quite strange!

Consider two objects a and b that both reference a String. a is
declared as a String but b is only an Object. When I dynamically
invoke with either a or b as an argument I would expect the MethodType
passed to the bootstrap method to be identical.

String a = "hello";
Object b = a;
InvokeDynamic.<void>foo(a);
InvokeDynamic.<void>foo(b);

However, when called with a, the MethodType is (java.lang.String)void;
but with b, it is (java.lang.Object)void.

I've dug around all over the place but can't find anything that
confirms what the behaviour should be in this case. I was hoping
invokedynamic could be used for multiple dispatch but that doesn't
appear possible.

I'm interested what the intended functionality is in this case. Is
that a bug or intended?

Thanks,
Larry
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to