Initial set of Ward sgen annotations (#5705)
[mono.git] / mcs / tests / gtest-523.cs
1 using System;
2 using System.Collections.Generic;
3
4 namespace Test
5 {
6         internal struct TestClass4<T> : IEquatable<TestClass4<T>>, IEquatable<T>, IEqualityComparer<TestClass4<T>> where T : class
7         {
8                 public bool Equals (T obj)
9                 {
10                         return true;
11                 }
12
13                 public bool Equals (TestClass4<T> entry)
14                 {
15                         return true;
16                 }
17
18                 public bool Equals (TestClass4<T> x, TestClass4<T> y)
19                 {
20                         return x.Equals (y);
21                 }
22
23                 public int GetHashCode (TestClass4<T> obj)
24                 {
25                         return obj.GetHashCode ();
26                 }
27
28                 public override int GetHashCode ()
29                 {
30                         return 1;
31                 }
32
33                 public override bool Equals (object obj)
34                 {
35                         return false;
36                 }
37
38                 public static bool operator == (TestClass4<T> entry1, TestClass4<T> entry2)
39                 {
40                         return entry1.Equals (entry2);
41                 }
42
43                 public static bool operator == (T entry1, TestClass4<T> entry2)
44                 {
45                         return entry2.Equals (entry1);
46                 }
47
48                 public static bool operator == (TestClass4<T> entry1, T entry2)
49                 {
50                         return entry1.Equals (entry2);
51                 }
52
53                 public static bool operator == (object entry1, TestClass4<T> entry2)
54                 {
55                         return entry2.Equals (entry1);
56                 }
57
58                 public static bool operator == (TestClass4<T> entry1, object entry2)
59                 {
60                         return entry1.Equals (entry2);
61                 }
62
63                 public static bool operator != (TestClass4<T> entry1, TestClass4<T> entry2)
64                 {
65                         return !(entry1 == entry2);
66                 }
67
68                 public static bool operator != (T entry1, TestClass4<T> entry2)
69                 {
70                         return !(entry1 == entry2);
71                 }
72
73                 public static bool operator != (TestClass4<T> entry1, T entry2)
74                 {
75                         return !(entry1 == entry2);
76                 }
77
78                 public static bool operator != (object entry1, TestClass4<T> entry2)
79                 {
80                         return !(entry1 == entry2);
81                 }
82
83                 public static bool operator != (TestClass4<T> entry1, object entry2)
84                 {
85                         return !(entry1 == entry2);
86                 }
87         }
88
89         class C
90         {
91                 public static void Main ()
92                 {
93                         new TestClass4<string> ();
94                 }
95         }
96 }
97