[Mono-dev] Distinction between generic type and instance type

Marek Safar marek.safar at gmail.com
Wed Feb 6 15:50:52 UTC 2013


Hey,

As a follow-up to my question about the way in which Mono handles generic
> types (see "Handling of generics by Mono compiler" on January 15), please
> do
> you know whether the distinction being made by Mono between a generic type
> and the instance type corresponding to it is only of relevance to the
> compiler, or does it have real implications for an application-level
> developer? (This relates to the comment Marek Safar made in the previous
> thread, namely: "Compiled generic types always exist at least as open
> (generic) types, usually TypeContainer(s) but can at the same time exist as
> InflatedTypeSpec too when accesses from within the type.")
>

That's correct but all this applies to mcs internals only. Mono runtime
handles this differently.


>
> I'm working on a static analysis tool, and it would arguably be quite
> helpful to blur the distinction between the two for the purposes of writing
> queries over the source code (i.e. query writers shouldn't necessarily have
> to know about compiler internals), but I'm loath to make that change if
> there's a practical difference between the two that's relevant even outside
> the compiler.
>

That's should be possible when you don't need to define generic types or
handle expressions like
var a = typeof (Foo<,,,>);

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130206/166e5afb/attachment.html>


More information about the Mono-devel-list mailing list