2010-05-31 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-063.cs
blobcb57c5146555981b1adcb0e89b27f0143bf2f6d0
1 using System;
3 public class Test
5 public static int IndexOf (Array array, object value)
7 // This is picking the non-generic version.
8 return IndexOf (array, value, 0, array.Length);
11 public static int IndexOf (Array array, object value, int startIndex, int count)
13 return 2;
16 public static int IndexOf<T> (T[] array, T value, int startIndex, int count)
18 return 1;
22 class X
24 static int Main ()
26 Test test = new Test ();
27 string[] array = new string [] { "Hello" };
29 int result = Test.IndexOf (array, array);
30 if (result != 2)
31 return 1;
33 string hello = "Hello World";
34 // This is picking the generic version.
35 result = Test.IndexOf (array, hello, 1, 2);
36 if (result != 1)
37 return 2;
39 return 0;