Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / class / corlib / System.Reflection.Emit / DynamicMethod.cs
index b038897d1db4f765f0e304104703a4a060ecbad8..931573d5449459c3860e103b5dab2811d820ee2c 100644 (file)
@@ -31,6 +31,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !FULL_AOT_RUNTIME
 
 using System;
 using System.Reflection;
@@ -112,6 +113,9 @@ namespace System.Reflection.Emit {
                                        if (parameterTypes [i] == null)
                                                throw new ArgumentException ("Parameter " + i + " is null", "parameterTypes");
                        }
+                       if (owner != null && (owner.IsArray || owner.IsInterface)) {
+                               throw new ArgumentException ("Owner can't be an array or an interface.");
+                       }
 
                        if (m == null)
                                m = AnonHostModuleHolder.AnonHostModule;
@@ -447,3 +451,4 @@ namespace System.Reflection.Emit {
        }
 }
 
+#endif