The reason for this is that marking a function as returning T?
just means that it can return null. But the type of T
in this function is still int
as passed in the type parameter but int?
translates into a totally different type: Nullable<int>
.