[Mono-list] Array should have a Count property?

Nick Drochak ndrochak@gol.com
Thu, 22 Nov 2001 00:19:57 +0900


All,

Thanks to Serge for helping me get past the Hashtable test problem, now
on to more fun with testing!

My first baffling question is this: Why doesn't the MS version of Array
does have a Count property even though Array implements ICollection.
(Mono's version of Array does, BTW.)

I ask this because I am getting an error on the unit test for Stack.
It's complaining thusly:

TestICollectionConstructor(MonoTests.System.Collections.StackTest): An
attempt was made to load a program with an incorrect
format.(System.BadImageFormatException)
   at System.Security.CodeAccessPermission.Copy()
   at System.Collections.Stack..ctor(ICollection collection) in
C:\cygwin\home\Nick\mcs\class\corlib\System.Collections\Stack.cs:line 35
   at
MonoTests.System.Collections.StackTest.TestICollectionConstructor()

The constructor for Stack is being passed an array.  Then the
constructor tries to access (through the ICollection interface) the
array's Count property which does not exist.  Why does this *not* fail
when we use mscorlib?  

I've got mono's Array.cs excluded from the build of corlib_res.dll, so
there must be another class that isn't ready for prime time yet.  Can
anyone point the way?

Thanks,
Nick D.