Skip to main content

RCS1249: Unnecessary null-forgiving operator

Properties​

PropertyValue
Default SeverityInfo
Minimum language version8.0

Examples​

Example #1​

diagnostic.cs
string? s = null!;
fix.cs
string? s = null;

Example #2​

diagnostic.cs
class C
{
private string? _value = null!;
}
fix.cs
class C
{
private string? _value;
}

Applies to​