[runtime] Fix DISABLE_REFLECTION_EMIT build.
[mono.git] / mono / tests / bug-575941.cs
index cade944465d2cec05464d6f3e8161d11a9537a47..c7535900ff47b54fe5cd1f15911850c482e36550 100644 (file)
@@ -20,6 +20,7 @@ public class Tests
                GenericTypeParameterBuilder [] typeParams = if_tb.DefineGenericParameters ("T");
 
                MethodBuilder if_mb = if_tb.DefineMethod ("foo", MethodAttributes.Public|MethodAttributes.Abstract|MethodAttributes.Virtual, typeParams [0], Type.EmptyTypes);
+               MethodBuilder if_mb2 = if_tb.DefineMethod ("foo2", MethodAttributes.Public|MethodAttributes.Abstract|MethodAttributes.Virtual, typeParams [0], Type.EmptyTypes);
 
 
                TypeBuilder tb = module.DefineType ("Foo`1", TypeAttributes.Public, typeof (object));
@@ -42,6 +43,7 @@ public class Tests
                gen.Emit (OpCodes.Ret);
 
                tb.DefineMethodOverride (mb, TypeBuilder.GetMethod (inst, if_mb));
+               tb.DefineMethodOverride (mb, TypeBuilder.GetMethod (inst, if_mb2));
 
                var k = if_tb.CreateType ();
 
@@ -49,6 +51,7 @@ public class Tests
                object obj = Activator.CreateInstance (t.MakeGenericType (new Type [] { typeof (string)}));
                var info = k.MakeGenericType (new Type [] { typeof (string) }).GetMethod ("foo");
                var res = info.Invoke (obj, null);
+
                return res == null ? 0 : 1;
        }
 }