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

Rafael Teixeira monoman at gmail.com
Wed Feb 6 15:39:13 UTC 2013

I just think that if you would query such a thing as "list all classes with
a method that returns an integer", the generic class:

public class Doer<T> {

public T Do() {...}


... shouldn't be listed but this instanced version probably should:

public class DoOnInt : Doer<int> {}

Hope it helps,

Rafael "Monoman" Teixeira
"The most exciting phrase to hear in science, the one that heralds new
discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
Isaac Asimov
US science fiction novelist & scholar (1920 - 1992)

On Wed, Feb 6, 2013 at 1:28 PM, Stuart Golodetz <stuart at semmle.com> wrote:

> Hi,
> 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.")
> 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.
> I realise it's a bit of a difficult question to answer without the full
> context, but any thoughts would be extremely welcome.
> Cheers,
> Stuart
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Distinction-between-generic-type-and-instance-type-tp4658491.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130206/807d8e3b/attachment.html>

More information about the Mono-devel-list mailing list