From: Edwin P. <ed...@pe...> - 2008-05-19 11:09:16
|
On Monday 19 May 2008 12:43:55 Gary Pampara wrote: > David, based on the code you sent in the last email, are you compiling the > code in C#? I'm not sure if that's possible as I don't know much about > .net. Also, Java 1.5+ uses covariant return types so we can "overload" the > return of the getClone() to make the code cleaner. Sounds like IKVM might not support covariant return types? > There are several reasons why we decided to add the getClone(). > Incidentally the Clonable interface in CIlib extends java.util.Cloneable. > I need to check my notes why we didn't directly use the clone() withing > Java, but one of the reasons that come to mind is that an base Object is > returned. This caused some issues with a few classes, lemme get the exact > reason and get back to you. If I remember correctly we had problems with > some of the Java generics. I'd be keen to understand those reasons -- the down cast from Object in a subclass isn't really that ugly. Well it is ugly, but it's not ugly enough to warrant doing things in non-standard ways IMHO. It makes it harder for new developers to understand what's going on because they expect it to work in a certain way, and in this particular case, the use of covariant returns types might just be what's breaking David's code in the IKVM environment. Regards, Edwin Peer -- #include http://www.peer.co.za/~espeer/disclaimer.html |