Fetching contributors…
Cannot retrieve contributors at this time
40 lines (29 sloc) 846 Bytes

RCS1165: Unconstrained type parameter checked for null

Property Value
Id RCS1165
Category Usage
Default Severity Hidden
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -


Code with Diagnostic

public void Foo<T1>() where T1 : new()
    var x = default(T1);

    if (x == null) // RCS1165

Code with Fix

if (EqualityComparer<T1>.Default.Equals(x, default(T1)))

See Also

(Generated with DotMarkdown)