This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: interface dispatch
- To: Godmar Back <gback at cs dot utah dot edu>
- Subject: Re: interface dispatch
- From: Per Bothner <per at bothner dot com>
- Date: 23 Oct 1999 23:11:18 -0700
- Cc: java-discuss at sourceware dot cygnus dot com
- References: <199910231923.NAA02129@faith.cs.utah.edu>
Godmar Back <gback@cs.utah.edu> writes:
> In an earlier discussion, I pointed out that the correct way to compile
>
> interface A {}
> f(A x) {
> x.equals(...)
> }
>
> is by using "invokeinterface" as opposed to "invokevirtual", and that the
> correct run-time semantics is
>
> checkcast A
> invokevirtual "equals"
Yes, you said that, but I really want to see an explanation
before I buy it. My understanding is that checkcast are
only needed when a source cast is needed.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/