Evolving the wrapper classes

Dan Smith daniel.smith at oracle.com
Fri Jun 19 20:16:48 UTC 2020


> On Jun 19, 2020, at 1:51 PM, forax at univ-mlv.fr wrote:
> 
> covariant return type
>  interface I {
>     int foo();
>  }
>  interface J {
>     Object foo();
>  }
>  class A implements I, J {
>    int foo();
>  }
> 
> with I.java compiled a long time ago.

Nothing in this proposal changes how these classes are compiled. The following methods will exist:

I.foo()I
J.foo()Ljava/lang/Object;
A.foo()I
A.foo()Ljava/lang/Object; // bridge

I think you may be mixed up thinking that we'll sometimes translate 'int' in a descriptor to 'Ljava/lang/Integer$val;', but that's not the case. 'I' is preferred wherever possible.



More information about the valhalla-spec-experts mailing list