예제 #1
0
        public void Test_ldvirtftn3()
        {
            var method = new DynamicMethod(Guid.NewGuid().ToString(), typeof(void), Type.EmptyTypes, typeof(string), true);
            var il     = new GroboIL(method);

            il.Newobj(typeof(C2).GetConstructor(Type.EmptyTypes));
            Assert.Throws <InvalidOperationException>(() => il.Ldvirtftn(typeof(I1).GetMethod("Zzz")));
        }
예제 #2
0
        public void Test_ldvirtftn2()
        {
            var method = new DynamicMethod(Guid.NewGuid().ToString(), typeof(void), Type.EmptyTypes, typeof(string), true);

            using (var il = new GroboIL(method))
            {
                il.Newobj(typeof(C1).GetConstructor(Type.EmptyTypes));
                il.Ldvirtftn(typeof(I1).GetMethod("Zzz"));
                il.Pop();
                il.Ret();
            }
        }