`RCS1256`: Allow null-checks on virtual method overrides
RenderMichael opened this issue · comments
Product and Version Used:
Roslynator 4.12.2
Steps to Reproduce:
using System;
class Base
{
protected virtual void M(string? str) { }
}
class Derived : Base
{
protected override void M(string? str)
{
ArgumentNullException.ThrowIfNull(str);
// process str
}
}
Actual Behavior:
Warns on ArgumentNullException.ThrowIfNull(str);
Expected Behavior:
In my opinion, no warning - we're locked into the nullable argument because of the virtual method.