[Mono-list] NullReferenceException in rootcontext.cs

Miguel de Icaza miguel@ximian.com
17 Sep 2001 00:23:47 -0400


> But I got an exception:
> 
>   Unhandled Exception: System.NullReferenceException: Value null was found
>   where an instance of an object was required.
>   at CIR.RootContext.IsNamespace(String name) in 
>   c:\bjepson\src\mono-15-Sep-01\mcs\mcs\rootcontext.cs:line 568

Seems like a bug that we just introduced recently.  I guess the need
for a regression test suite is needed now more than ever so that we do
not commit code that breaks the previously working features
inadvertently.

> The attached patch fixes this problem for me, by enclosing the offending
> line in a try...catch block.  Once I did that, I had a foo.exe that runs
> great and looks very nice with ILDASM.  Great work - this is very nice to
> see!

The code should also perform all kinds of arithmetic on local
variables and parameters (notice that we dont have fields yet ;-).

You should also be able to invoke constructors and methods on other
interesting objects (although constructor handling for your own
classes has a bug right now that I will fix tomorrow).

Best wishes,
Miguel.