Possible Duplicate:
Nullable type as a generic parameter possible?
I came across a very weird thing with generic type constraints. I have a class like this:
public SomeClass<T> where T:class
{
}
However, I've found I can't use nullable types as I'd expect:
new SomeClass<int?>();
I get an error that int?
must be a reference type. Is Nullable really just a struct with syntactic sugar to make it look like a reference type?