Copy&paste bug.
[mono.git] / mcs / tests / gen-63.cs
1 using System;
2
3 public class Test
4 {
5         public int Length {
6                 get {
7                         return 1;
8                 }
9         }
10
11         public static implicit operator object[] (Test test)
12         {
13                 return new object[1] { test };
14         }
15
16         public static int IndexOf (Test array, object value)
17         {
18                 // The non-generic function is better than the generic one whose type
19                 // arguments have been infered.
20                 return IndexOf (array, value, 0, array.Length);
21         }
22
23         public static int IndexOf (Test array, object value, int startIndex, int count)
24         {
25                 return 2;
26         }
27
28         public static int IndexOf<T> (T[] array, T value, int startIndex, int count)
29         {
30                 return 1;
31         }
32 }
33
34 class X
35 {
36         static int Main ()
37         {
38                 Test test = new Test ();
39                 int result = Test.IndexOf (test, test);
40                 if (result == 2)
41                         return 0;
42                 else
43                         return 1;
44         }
45 }