Why doesn't C# compiler simply call default implicit parameterless .ctor
instead of intobj
for null
assigned nullable value types?
Lets say we have such as code:
Nullable<int> ex1 = new Nullable<int>();
Nullable<int> ex2 = null;
Nullable<int> ex3 = new Nullable<int>(10);
The IL output for these two lines look like this:
It only call .ctor
for last statement and why cannot we have the an instance for two first statements with zeroed fields?