The code below triggers S1694. However, in the case where there is logic using the constructor arguments in the abstract class, it should not be converted to an interface.
Repro steps
public abstract class Foo
{
protected int _data;
protected Foo(int data)
{
_data = data * 2;
}
public abstract void Bar();
}
Expected behavior
S1694 should not fire as the constructor argument/code makes it unsuitable to convert to an interface. This code could be quite complex and should be shared between all subclasses.
Description
The code below triggers S1694. However, in the case where there is logic using the constructor arguments in the abstract class, it should not be converted to an interface.
Repro steps
Expected behavior
S1694 should not fire as the constructor argument/code makes it unsuitable to convert to an interface. This code could be quite complex and should be shared between all subclasses.
Actual behavior
S1694 does trigger.
Known workarounds
Suppress the issue.
Related information