Code inspection: Redundant explicit nullable type creation
This inspection reports an explicit nullable value creation such as new int?(value) when the value can be used directly. The explicit new Nullable<T>(...) form is usually redundant in ordinary C# code.
Example
class C
{
int? GetValue()
{
return new int?(10);
}
}
class C
{
int? GetValue()
{
return 10;
}
}
Quick-fix
The quick-fix removes the explicit nullable value creation.
13 April 2026