Hi there,

I will try to explain it on an example: let's say we have a class
MyList (which inherits from List<int>), I would like to have an
extension method that I would give MyList and IEnumerable<> (as
TypeDefinitions) and it would return a collection of TypeReferences
with one item -- System.Int32, because MyList implements/is assignable
to IEnumerable<System.Int32>.

For this I think I have to traverse all the interfaces that MyList
implements and also interfaces that super-types of MyList implement
(and all interfaces these interfaces implement..., but traversing the
type hierarchy is not the problem here). The problem is that when I
want to access a base class or the list of interfaces I have to use
Resolve (to get a TypeDefinition), but when I use Resolve on generic
type instance e. g. List[[System.Int32, ...]] it resolves such type
into e. g. List[[T, ...]] so the actual type of the generic parameter
is lost. I think I have some insight on why this happens, but is there
any way how I could implement my extension method?

Steves

-- 
--
mono-cecil

Reply via email to