Bug 9861 and Java 5 Generics
Per Bothner
per@bothner.com
Wed Aug 17 17:58:00 GMT 2005
Andrew Haley wrote:
> It might be possible to preserve some measure
> of binary compatibility by providing aliases that don't encode the
> return type.
Could you point to summary of why we need return types? Is it for
generics, or for co-variant return types, or both?
If it is for co-variant return types, then C++ supports those, so
why can't we use the ABI it uses? A complication is that we have
to handle .class files that contains javac-generated stub methods
that implement the JDK mechanism for co-variant return types,
but it should be possible to suppress generating code for those
methods. (A further complication is that this has to be done
for both the compiler and the interpreter, at least to the
extent that we produce compatible vtable and interface tables.)
Either way, if there is a way to provide "binary compatibility by
providing aliases that don't encode the return type" that implies
the compiler can identity a label that doesn't need the return type
encoded. So why not just leave them out in that case?
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Java
mailing list