JSR 292 support, minor change to specification

Neal Gafter neal at gafter.com
Thu Apr 22 14:04:31 PDT 2010


On Thu, Apr 22, 2010 at 1:59 PM, John Rose <john.r.rose at oracle.com> wrote:

> As far as the type system is concerned MH.invoke{Exact,Generic} and
> InvokeDynamic.foo return an unconstrained result like the following method,
> which is unrelated to any other type or type variable:
>

That is not correct.  Every type variable extends java.lang.Object and is
extended by the null type.  That is necessary because local type inference
requires that the type universe be a lattice. That is achieved by
restricting attention to the reference types.


> class Foo {
>  static <T> T nothingParticular(int a, String b) { return null; }
> }
>
> Float i = nothingParticular(123, "456");
> Integer i = nothingParticular(123, "456");
> int j = nothingParticular(123, "456");
>



More information about the coin-dev mailing list