I am trying to do something simple: creating an instance with generics. I get an error saying that I cannot create an instance because I do not have the new
constraint. However, I do have it on my return statement! Any thoughts?
public IAction CreateAction<TA, TP>(ActionParamBase param)
where TA : IAction
where TP : ActionParamBase
{
Ensure.That(param).Is<TP>();
return new TA { Param = param as TP };
}