Code inspection: Type parameter could be declared as covariant or contravariant
This inspection reports an interface or delegate type parameter that can be marked out or in. This makes the generic API more flexible for callers without changing its meaning.
Example
interface IProducer<T>
{
T Create();
}
interface IProducer<out T>
{
T Create();
}
Quick-fix
Add the suggested variance modifier, such as out or in, to the type parameter.
29 March 2026