You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A C# record can specify a base record and set some of its properties in the call to the base constructor.
Repro steps
public abstract record RuleApplyResult(bool Success);
public record RuleApplyDone() : RuleApplyResult(true); // FP - RuleApplyDone is a more specific version of RuleApplyResult
public record RuleApplySkipped(string Reason) : RuleApplyResult(false); // FP - RuleApplySkipped is a more specific version of RuleApplyResult
Expected behavior
No issue should be raised for the descendant records.
Actual behavior
An issue is raised for the descendant (more specific) record.
Related information
v8.54
The text was updated successfully, but these errors were encountered:
zsolt-kolbay-sonarsource
changed the title
Fix S2094 FP: Allow to have empty class with non-empty ctor for base class
Fix S2094 FP: Records which set the base record's properties in their initializer
Mar 28, 2023
Description
A C# record can specify a base record and set some of its properties in the call to the base constructor.
Repro steps
Expected behavior
No issue should be raised for the descendant records.
Actual behavior
An issue is raised for the descendant (more specific) record.
Related information
v8.54
The text was updated successfully, but these errors were encountered: