This warning is surprising.
public class C
{
public void M()
{
string? s = "";
M(ref s); // warning CS8600: Converting null literal or possible null value to non-nullable type.
}
void M(ref string? s) => throw null;
}
Note: this is also a scenario where we think a special attribute could make sense (this method never sets the ref parameter to null).
Tagging @cston
This warning is surprising.
Note: this is also a scenario where we think a special attribute could make sense (this method never sets the
refparameter tonull).Tagging @cston