public interface SomeInterfaceName<out T> where T : struct
{
T? SomePropertyName { get; }
}
The error I get is:
error CS1961: Invalid variance: The type parameter 'T' must be invariantly valid on 'SomeInterfaceName.SomePropertyName'. 'T' is covariant.
I do not need this to be Covariant. I could as well delete the out keyword. But then Resharper is suggesting I could use Covariance and I agree, I don't see why I could not. I'm only using T as return value. Or is it because Nullable<> does not support it?
Can anybody explain the error?