I can see that not working.
But what is stopping you from doing this?
public void ThisIsANoNo<T>() where T : MyBaseClass
{
MyBaseClass foo = new MyBaseClass("whoops!");
}
Since everything is going to inherit from MyBaseClass they will al be MyBaseClass, right?
I tried it and this works.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ThisIsANoNo<MyClass>();
ThisIsANoNo<MyBaseClass>();
}
public class MyBaseClass
{
public MyBaseClass() { }
public MyBaseClass(object arg) { }
}
public class MyClass :MyBaseClass
{
public MyClass() { }
public MyClass(object arg, Object arg2) { }
}
public static void ThisIsANoNo<T>() where T : MyBaseClass
{
MyBaseClass foo = new MyBaseClass("whoops!");
}
}
}