Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:netway:mono58
mono
mono-174c4317b1cf70bd25762dc1a816f348b6d7f2e7.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mono-174c4317b1cf70bd25762dc1a816f348b6d7f2e7.diff of Package mono
diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index 91eecdc..3f65556 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -102,17 +102,7 @@ protected Delegate (Type target, string method) public MethodInfo Method { get { - if (method_info != null) { - return method_info; - } else { - if (method != IntPtr.Zero) { - if (!method_is_virtual) - method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); - else - method_info = GetVirtualMethod_internal (); - } - return method_info; - } + return GetMethodImpl (); } } @@ -511,7 +501,17 @@ public override int GetHashCode () protected virtual MethodInfo GetMethodImpl () { - return Method; + if (method_info != null) { + return method_info; + } else { + if (method != IntPtr.Zero) { + if (!method_is_virtual) + method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); + else + method_info = GetVirtualMethod_internal (); + } + return method_info; + } } // This is from ISerializable diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs index 795593d..1b54b97 100644 --- a/mcs/class/corlib/System/MulticastDelegate.cs +++ b/mcs/class/corlib/System/MulticastDelegate.cs @@ -33,6 +33,7 @@ using System.Collections; using System.Collections.Generic; +using System.Reflection; using System.Runtime.Serialization; using System.Runtime.InteropServices; @@ -125,6 +126,14 @@ public sealed override int GetHashCode () return base.GetHashCode (); } + protected override MethodInfo GetMethodImpl () + { + if (delegates != null) + return delegates [delegates.Length - 1].Method; + + return base.GetMethodImpl (); + } + // <summary> // Return, in order of invocation, the invocation list // of a MulticastDelegate diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index d0e26ed..f784c41 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -188,6 +188,7 @@ BASE_TEST_CS_SRC= \ delegate10.cs \ delegate11.cs \ delegate12.cs \ + delegate13.cs \ remoting1.cs \ remoting2.cs \ remoting3.cs \ diff --git a/mono/tests/delegate13.cs b/mono/tests/delegate13.cs new file mode 100644 index 0000000..3a4cfd0 --- /dev/null +++ b/mono/tests/delegate13.cs @@ -0,0 +1,31 @@ +using System; + +public static class Program +{ + public static int Main () + { + Action d1 = new Action (Method1); + Action d2 = new Action (Method2); + Action d12 = d1 + d2; + Action d21 = d2 + d1; + + if (d1.Method.Name != "Method1") + return 1; + if (d2.Method.Name != "Method2") + return 2; + if (d12.Method.Name != "Method2") + return 3; + if (d21.Method.Name != "Method1") + return 4; + + return 0; + } + + public static void Method1 () + { + } + + public static void Method2 () + { + } +} \ No newline at end of file
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor