[Mono-list] Big array bug?

J. Perkins jason@379.com
07 Nov 2002 09:32:41 -0500


Here's the code:

using System;

class ArrayBug
{
	static void Main()
	{
		string[] strings = new string[4];
		
		for (int i = 0; i < 4; ++i)
		{
			GetString(out strings[i], i);
			Console.WriteLine("[{0}] = {1}", i, strings[i]);
		}
	}
	
	static void GetString(out string s, int i)
	{
		s = String.Format("This is string {0}", i);
	}
}


Under .NET/csc, this displays:

   [0] = This is string 0
   [1] = This is string 1
   [2] = This is string 2
   [3] = This is string 3

Under Mono/mcs, this displays:

   [0] = This is string 0
   [1] =
   [2] = 
   [3] = This is string 1

I have started investigating it, but I suspect someone here might know
exactly where the problem lies.

Jason
379