Hey, There's nothing wrong here that jumps at me.
System._Canon is an implementation detail of the .NET framework. It doesn't necessarily mean you're doing something wrong here. Do you get a runtime exception when invoking it? Thanks, Jb On Mon, Feb 15, 2016 at 8:37 AM, Dudi Keleti <[email protected]> wrote: > I have this code: > > static class x<T> > { > private class c > { > public static readonly c _9 =new c(); > public static Func<T, object> _9__0_0; > > public object b__0_0(T t) > { > return new object(); > } > } > > public static Func<T, object> m0() > { > return x<T>.c._9__0_0 = new Func<T, object>(x<T>.c._9.b__0_0); > } > } > > I want to get b___0_0(T t) method by call GetMethodFromHandle with method > handle and type. > > How can I get the method with an instantiated generic parameter > > I tried this: > > if(method.DeclaringType.HasGenericParameters) > { > var genericType = > method.DeclaringType.MakeGenericInstanceType(method.DeclaringType.GenericParameters.ToArray()); > var methodRef = new MethodReference( > method.Name, > method.ReturnType, > genericType); > method.Parameters.ToList().ForEach(p => > methodRef.Parameters.Add(p)); > processor.Emit(OpCodes.Ldtoken, methodRef); > processor.Emi(OpCodes.Ldtoken, genericType); > //Call GetMethodFromHandle > } > > but this code gave me b__0_0(System._Canon) > > -- > -- > -- > mono-cecil > --- > You received this message because you are subscribed to the Google Groups > "mono-cecil" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- -- mono-cecil --- You received this message because you are subscribed to the Google Groups "mono-cecil" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
