[Mono-list] Bug found in mcs...

Maurizio Colucci seguso.forever@tin.it
Tue, 29 Apr 2003 17:20:49 +0200


this looks like a bug in mcs.

public class C

  private class States    {
    public abstract class GenericState         {     }

    public class SearchState :       GenericState         {
      public SearchState() { }
  private void  foo ( out States.SearchState[] o)      { //<<<< HERE

  public static void Main(){}

The output is:

mcs -g  -o test.exe test-mono.cs
test-mono.cs(12) error CS0246: Cannot find type `SearchState[]&'

Unhandled Exception: System.NullReferenceException: A null value was found 
where an object instance was required
in <0x00050> 00 Mono.CSharp.MemberBase:CheckParameters 
in <0x00052> 00 Mono.CSharp.MethodCore:DoDefineParameters 
in <0x0002f> 00 Mono.CSharp.Method:CheckBase (Mono.CSharp.TypeContainer)
in <0x00042> 00 Mono.CSharp.Method:Define (Mono.CSharp.TypeContainer)
in <0x000df> 00 Mono.CSharp.TypeContainer:DefineMembers 
in <0x003e4> 00 Mono.CSharp.TypeContainer:DefineMembers 
in <0x003b4> 00 Mono.CSharp.RootContext:PopulateTypes ()
in <0x0070a> 00 Mono.CSharp.Driver:MainDriver (string[])
in <0x0000f> 00 Mono.CSharp.Driver:Main (string[])

Compilation finished at Tue Apr 29 17:18:54


It seems that mcs has problems with arrays passed with the "out"
keyword: if the brackets [] are removed, everything works.

It works with Visual Studio.

Maurizio Colucci