Hi,
I have following class:
public class Bar<T> where T: struct
{
}
Then I try to import method
Nullable.Equals<T>(Nullable<T> n1, Nullable<T> n2) where T: struct
I use following code:
var bar = module.GetType ("Bar`1");
var msCoreLibDefinition = module.AssemblyResolver.Resolve("mscorlib");
var msCoreTypes = msCoreLibDefinition.MainModule.Types;
TypeDefinition nullableDefinition = msCoreTypes.Where(x => x.Name ==
"Nullable").First();
var nullableEqualsMethod = module.Import(nullableDefinition).Resolve().
Methods.Where(x => x.Name == "Equals").First();
var genericInstanceMethod = new GenericInstanceMethod(nullableEqualsMethod);
genericInstanceMethod.GenericArguments.Add (bar.GenericParameters [0]);
module.Import(genericInstanceMethod);
Unfortunately, call of import method raises exception.
Does anyone know wether it is a Mono.Cecil bug or I do something wrong?
--
--
--
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.