public class YourIntDecl : IMinMaxDecl<Int16>
{
public Int16? MinValue { get; set; }
public Int16? MaxValue { get; set; }
}
YourIntDecl : IMinMaxDecl<Int16?> Should fix it no? You are telling the generic type it Must be of type Int16 that doesn't allow null. But the type expected is a nullable type.
The reason the abstract class works, I think, is because the abstract comes with a base implementation of Int16? While the interface has no inherent properties. It can only force your Implemention to have a property of type T. Which you provide as Int16 non nullable.
In the non compiling example, you are in fact NOT, abiding by the interface contract.