Put back MethodInfo.CreateDelegate() and fix DynamicMethod.
authorMartin Baulig <martin.baulig@xamarin.com>
Wed, 13 Mar 2013 18:19:05 +0000 (14:19 -0400)
committerMartin Baulig <martin.baulig@xamarin.com>
Wed, 13 Mar 2013 18:19:05 +0000 (14:19 -0400)
mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs
mcs/class/corlib/System.Reflection/MethodInfo.cs

index 0e87b8a340f3b227dd7a3753fedcae21ebcd16c3..5805c00c31df77d87aeacf23ed517c1f777c0fc4 100644 (file)
@@ -162,6 +162,9 @@ namespace System.Reflection.Emit {
                }
 
                [ComVisible (true)]
+#if NET_4_5
+               sealed override
+#endif
                public Delegate CreateDelegate (Type delegateType)
                {
                        if (delegateType == null)
@@ -176,6 +179,9 @@ namespace System.Reflection.Emit {
                }
 
                [ComVisible (true)]
+#if NET_4_5
+               sealed override
+#endif
                public Delegate CreateDelegate (Type delegateType, object target)
                {
                        if (delegateType == null)
index 7d6e1d721f9caf638bc4cfacda731eed2b72ae1a..74f96f55428f03dcc775dcd1c09698251f8af648 100644 (file)
@@ -163,8 +163,6 @@ namespace System.Reflection {
                }
 #endif
 
-// FIXME: This breaks dynamic methods which also have a non-virtual CreateMethod () method.
-#if FALSE
 #if NET_4_5
                public virtual Delegate CreateDelegate (Type delegateType)
                {
@@ -175,7 +173,6 @@ namespace System.Reflection {
                {
                        return Delegate.CreateDelegate (delegateType, target, this);
                }
-#endif
 #endif
        }
 }