Hey... I dont know if its possible but i'm trying to emit a class that would
look like this

The Base class commes from the code:

public class BaseClass<T>
{
// Whatever implementation...
}

I want to generate a child class that looks like this:

public class ChildClass<T> : BaseClass<T>
{
}

so i want to define ChildClass<> not ChildClass<int> or ChildClass<object>
...is it possible?

Re: Emitting a Generic Type that has a Generic Base Class by Barry

Barry
Wed Jun 07 11:14:57 CDT 2006

Patrick <Patrick@discussions.microsoft.com> wrote:

> Hey... I dont know if its possible but i'm trying to emit a class that would
> look like this

By emit, do you mean System.Reflection.Emit, or do you simply mean
compiled C# code?

> The Base class commes from the code:
>
> public class BaseClass<T>
> {
> // Whatever implementation...
> }
>
> I want to generate a child class that looks like this:
>
> public class ChildClass<T> : BaseClass<T>
> {
> }

This descendant is perfectly possible and legal currently. It's the
standard pattern for deriving from Collection<T>, for example.

> so i want to define ChildClass<> not ChildClass<int> or ChildClass<object>
> ...is it possible?

What does 'ChildClass<>' mean?

-- Barry

--
http://barrkel.blogspot.com/