Skip to content

Commit

Permalink
Improve documentation of MA0056 (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou authored Oct 4, 2023
1 parent 4e703c6 commit 8176292
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/Rules/MA0056.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Sample
public Sample()
{
// What does it do?
// new Sample2() prints "0"
VirtualMethod(); // Non compliant
}

Expand All @@ -20,14 +21,13 @@ class Sample2 : Sample
{
private int value;

public Sample2()
{
value = 42;
}
public Sample2() => value = 42;

protected override void VirtualMethod()
{
Console.WriteLine(value);
}
}
````

The diagnostic is not reported in `sealed` classes.

0 comments on commit 8176292

Please sign in to comment.