Hi,
I ran in to the following:
public void AddConfig<T>(Config c) where T : BaseTypeA
{
// do stuff
}
public void AddConfig<T>(Config c) where T : BaseTypeB
{
// do stuff
}
I would love to be able to do this. But i think it's impossible. The compiler ignores the constraints. Why? (I know it's by design).
I think my 2 options are:
- Make 2 distinct functions.
- Make 2 distinct Config classes.
Right?