Re: ikvmc

Jeroen Frijters <[email protected]> Fri, 21 Oct 2016 07:25:40 +0000
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <[email protected]>
Hi Christian,

Java doesn't support value types, so there is no way for IKVM to sensibly support mutable value types.

Regards,
Jeroen

> -----Original Message-----
> From: Mohr, Christian [mailto:[email protected]]
> Sent: Friday, October 21, 2016 8:48
> To: [email protected]
> Subject: [Ikvm-developers] ikvmc
> 
> I'm searching for help when using ikvmc of version 8.1.57.17.0.
> 
> My Java application references some jar files that I have created from
> .NET DLLs using ikvmstub.
> 
> After using them I wanted to convert the resulting jar back with ikvmc.
> It worked out and I got a resulting DLL.
> 
> Unfortunately the code inside this DLL does not work on my .NET 4.5.2
> environment. The reason is that ikvmc introduces a lot of unboxing
> conversions to the coding that my c# environment is not able to resolve.
> 
> Example:
> 
> The line
> 
> empMetaData.Id = exampleNodeId;
> 
> in my Java application turns into
> 
> ((EmpMetaData) (object) (EmpMetaData) this.empMetaData).Id = (__Null)
> EMPJavaExampleImplementation.exampleNodeId;
> 
> In the resulting DLL.
> 
> But to make it run it should look like this:
> 
> empMetaData.Id = exampleNodeId;
> 
> 
> 
> EMPMetaData is a struct in c#.
> 
> exampleNodeId is a static variable of my java class.
> 
> 
> 
> Can anybody give me a hint how my Java code has to look like to prevent
> ikvmc from unboxing ?
> 
> Best regards
> 
> Christian
> 
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot