Re: map.xml body vs alternateBody vs nonVirtualAlternateBody

Jeroen Frijters <[email protected]> Fri, 9 Sep 2016 08:55:49 +0000
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <[email protected]>
Hi Steve,

The normal one is <body>. The other two are only used for remapped types (Object, String and Throwable).

They have to the do the weird shape of the type system. E.g. on the Java side it looks like cli.System.Object extends java.lang.Object. This means that you can call java.lang.Object.toString() on a .NET type (that obviously doesn't have this method), so when that happens the <alternateBody> gets invoked.

Similarly, when you extend cli.System.Object in Java and do a super.toString() call, the <nonVirtualAlternateBody> gets invoked.

Regards,
Jeroen

> -----Original Message-----
> From: Steve Hannah [mailto:[email protected]]
> Sent: Thursday, September 8, 2016 18:32
> To: [email protected]
> Subject: [Ikvm-developers] map.xml body vs alternateBody vs
> nonVirtualAlternateBody
> 
> I have a question about the map.xml syntax.  What is the difference
> between <body>, <alternateBody>. and <nonVirtualAlternateBody>.  Some
> methods (e.g. toString()) include all three.  Under what circumstance is
> each used?
> 
> Best regards
> 
> Steve
------------------------------------------------------------------------------