[Mono-devel-list] array type constructors

Ian MacLean ianm at ActiveState.com
Sun Mar 23 09:37:49 EST 2003

When I interrogate an array type ( subtype of System.Array ) using 
reflection it appears to have no constructors. So the following code 
gets a single constructor on ms.net but none when run agains mono. It 
should have a single constructor taking an Int32 paramater so that you 
can do string[] foo = new string[12];

Type arraytype = Type.GetType("System.String[]" );
ConstructorInfo [] infos = arraytype.GetConstructors(
	BindingFlags.Public | BindingFlags.Static |
         BindingFlags.NonPublic | BindingFlags.Instance

Console.WriteLine( "Type {0} has {1} constructors and its base class is 
{2}", arrayTypeName, infos.Length, arraytype.BaseType.ToString() );


More information about the Mono-devel-list mailing list