diff options
author | Marek Safar <marek.safar@gmail.com> | 2010-07-03 19:42:27 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2010-07-03 19:42:27 +0400 |
commit | 906905c598ba0ea4ecbe5f4747e4e6c89e51db1c (patch) | |
tree | 6eac19ce3b091c8df9edf421f39d53c8e5e3655c /mcs/tests/gtest-523.cs | |
parent | 1a8f87e3dd391fd2c650ffe07d8aab64c81b0cc0 (diff) |
New test.
svn path=/trunk/mcs/; revision=159852
Diffstat (limited to 'mcs/tests/gtest-523.cs')
-rw-r--r-- | mcs/tests/gtest-523.cs | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/mcs/tests/gtest-523.cs b/mcs/tests/gtest-523.cs new file mode 100644 index 00000000000..fe53050095d --- /dev/null +++ b/mcs/tests/gtest-523.cs @@ -0,0 +1,97 @@ +using System;
+using System.Collections.Generic;
+
+namespace Test
+{
+ internal struct TestClass4<T> : IEquatable<TestClass4<T>>, IEquatable<T>, IEqualityComparer<TestClass4<T>> where T : class
+ {
+ public bool Equals (T obj)
+ {
+ return true;
+ }
+
+ public bool Equals (TestClass4<T> entry)
+ {
+ return true;
+ }
+
+ public bool Equals (TestClass4<T> x, TestClass4<T> y)
+ {
+ return x.Equals (y);
+ }
+
+ public int GetHashCode (TestClass4<T> obj)
+ {
+ return obj.GetHashCode ();
+ }
+
+ public override int GetHashCode ()
+ {
+ return 1;
+ }
+
+ public override bool Equals (object obj)
+ {
+ return false;
+ }
+
+ public static bool operator == (TestClass4<T> entry1, TestClass4<T> entry2)
+ {
+ return entry1.Equals (entry2);
+ }
+
+ public static bool operator == (T entry1, TestClass4<T> entry2)
+ {
+ return entry2.Equals (entry1);
+ }
+
+ public static bool operator == (TestClass4<T> entry1, T entry2)
+ {
+ return entry1.Equals (entry2);
+ }
+
+ public static bool operator == (object entry1, TestClass4<T> entry2)
+ {
+ return entry2.Equals (entry1);
+ }
+
+ public static bool operator == (TestClass4<T> entry1, object entry2)
+ {
+ return entry1.Equals (entry2);
+ }
+
+ public static bool operator != (TestClass4<T> entry1, TestClass4<T> entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (T entry1, TestClass4<T> entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (TestClass4<T> entry1, T entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (object entry1, TestClass4<T> entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (TestClass4<T> entry1, object entry2)
+ {
+ return !(entry1 == entry2);
+ }
+ }
+
+ class C
+ {
+ public static void Main ()
+ {
+ new TestClass4<string> ();
+ }
+ }
+} + |