Merge pull request #3381 from krytarowski/netbsd-support-20
[mono.git] / mcs / class / corlib / System / Delegate.cs
index 3f6555655945257c194c4a48fc88a3f7fb8f6288..4064ed9c90185ac0eec46c390977a61b4340a0f9 100644 (file)
@@ -60,7 +60,7 @@ namespace System
                private object m_target;
                private IntPtr method;
                private IntPtr delegate_trampoline;
-               private IntPtr rgctx;
+               private IntPtr extra_arg;
                private IntPtr method_code;
                private MethodInfo method_info;
 
@@ -534,6 +534,12 @@ namespace System
                        if (a == null)
                                return b;
 
+                       if (b == null)
+                               return a;
+
+                       if (a.GetType () != b.GetType ())
+                               throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types. First is {0} second is {1}.", a.GetType ().FullName, b.GetType ().FullName));
+
                        return a.CombineImpl (b);
                }