Description
S3253 is reported when a record with a parameterless constructor inherits another record that has parameters and passes them inline (instead of having an explicit base()-call).
Repro steps
public abstract record Base(string Value);
public record Foo() : Base("SomeValue");
Expected behavior
No S3253 is raised because the Foo()-constructor is not redundant.
Actual behavior
S3253 is raised.
Known workarounds
public abstract record Base(string Value);
public record Foo : Base
{
public Foo() : base("SomeValue")
{
}
}
Related information
SonarAnalyzer.CSharp: 9.14.0.81108