2007-01-25 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / Label.cs
index e6d99bc2bc56391fc40937156990ad8400f334e7..130fb9278fe9a062f7340958ff98ce5b912d6779 100644 (file)
@@ -45,12 +45,32 @@ namespace System.Reflection.Emit {
                        label = val;
                }
 
-               [MonoTODO]
                public override bool Equals (object obj) {
-                       /* FIXME */
-                       return false;
+                       bool res = obj is Label;
+
+                       if (res) {
+                               Label l = (Label)obj;
+                               res = (label == l.label);
+                       }
+
+                       return res;
+               }
+
+#if NET_2_0
+               public bool Equals (Label obj)
+               {
+                       return (label == obj.label);
                }
 
+               public static bool operator == (Label a, Label b) {
+                       return a.Equals (b);
+               }
+
+               public static bool operator != (Label a, Label b) {
+                       return !(a == b);
+               }
+#endif
+
                public override int GetHashCode () {
                        return label.GetHashCode ();
                }