I'd like to code a function like the following
public void Foo(System.Type t where t : MyClass)
{ ... }
In other words, the argument type is System.Type
, and I want to restrict the allowed Type
s to those that derive from MyClass
.
Is there any way to specify this syntactically, or does t
have to be checked at runtime?