When will C# support inheriting from type parameters

  • Thread starter Thread starter pmayer995
  • Start date Start date
P

pmayer995

To anyone from Microsoft, it'd be very helpful to have generics be
able to inherit from type parameters, i.e.:

public class FieldControl<T> : T where T : WebControl

should compile instead of giving error "Cannot derive from 'T' because
it is a type parameter". Allowing this would allow mixin classes,
allow multiple implementation inheritance without the issues usually
raised. Using aggregation instead is very tedious and much harder to
maintain. I think it'd be more useful than LINQ.

Any timeline?

Thanks,
Phil
 
Phil,

Unfortunately, MS's current policy on future features is to not talk
about them. You won't get a response from them committing or not committing
to this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top