Hi Jb,

the issue here is that I actually want to import an open generic type. I
have no interest in supplying the generic context to make it construct a
closed generic type from that. And the open generic type in this case has
the signature

Dictionary<string, TValue>

When I can read the open generic type reference from the assembly just fine,
I should be able to import it the same way. Or did I get something else
wrong here?

Just by the way, do you use a special term to refer to open generic types
that have arguments supplied, but some of them are parameters of their
context (hence they are still open but somehow "partially closed")?


Kind regards
Johannes


On Thu, Sep 9, 2010 at 5:57 PM, Jb Evain <[email protected]> wrote:

> Hey,
>
> On Thu, Sep 9, 2010 at 5:43 PM, Johannes Rudolph
> <[email protected]> wrote:
> > ModuleDefinition.Read and ModuleDefinition.Import handle generic type
> > arguments for an open generic type differently. ModuleDefinition.Read
> does
> > it correctly while ModuleDenifition.Import does not import the generic
> > parameter name correctly:
>
> Nope.
>
> > I am positive this has just something to do with the Importer. What are
> your
> > thoughts?
>
> Positive is good :) Now what going on there? You're asking Cecil to
> import the type:
>
> Dictionary<string, TValue>
>
> Without any other information. When it will stumble onto TValue, Cecil
> can not relate TValue to anything that is known at this time. So it
> tries it best (and gets it wrong in this case).
>
> You have to provide a context to Import when importing open types, so
> Cecil can know where to get the generic parameters.
>
> --
> Jb Evain  <[email protected]>
>
> --
> --
> mono-cecil

-- 
--
mono-cecil

Reply via email to