RCS1165: Unconstrained type parameter checked for null
Properties
| Property | Value |
|---|---|
| Default Severity | Hidden |
| Minimum language version | - |
Examples
Example #1
diagnostic.cs
public void Foo<T1>() where T1 : new()
{
var x = default(T1);
if (x == null)
{
}
}
fix.cs
if (EqualityComparer<T1>.Default.Equals(x, default(T1)))
{
}