Essentially, what we’ve got is this:
public class A {
...
public A() { ... }
...
}
public class B : A {
...
public B() : base()
{ throw new Exception(); }
...
}
But then:
public class Test<T>
where T : A, new()
{
public void doStuff() { B b = new B(); }
}
And no exception is thrown. It’s really quite confusing! Am I missing something?
The following code throws an exception as intended. I imagine you aren’t using your Test class correctly since you didn’t post the code.