dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DotGNU]Java compiler , more news


From: Jeroen Frijters
Subject: RE: [DotGNU]Java compiler , more news
Date: Fri, 25 Apr 2003 23:10:17 +0200

Rhys Weatherley wrote:
> - java.lang.Object inherits from System.Object

This doesn't work well. For example, CLI arrays and strings need to be
assignable to java.lang.Object, but they (obviously) aren't derived from
it. 

> - java.lang.Throwable inherits from java.lang.Object

I chose to make java.lang.Throwable an alias for System.Exception and do
some exception substitution in Java exception handlers (e.g.
System.NullReferenceException -> java.lang.NullPointerException). This
also requires playing some tricks with the virtual methods in Throwable.

> Does anyone know how Microsoft's J# handles this?  Or if they 
> do at all?

In their first beta java.lang.Object was a subclass of System.Object and
they had a huge hole in the type system (an unsafe method that could
cast any System.Object to a java.lang.Object, not a smart thing to do
especially since java.lang.Object introduced virtual methods not in
System.Object). In the release version they map java.lang.Object to
System.Object, java.lang.Throwable extends System.Exception and
java.lang.String maps to System.String.

J# is not a very good product (to put it mildly), but on the upside it's
lameness did inspire me to start working on http://ikvm.net

Regards,
Jeroen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]