rspec/rules/S1939/csharp/rule.adoc
2022-02-04 16:28:24 +00:00

41 lines
793 B
Plaintext

An inheritance list entry is redundant if:
* It is ``++Object++`` - all classes extend ``++Object++`` implicitly.
* It is ``++int++`` for an ``++enum++``
* It is a base class of another listed inheritance.
Such redundant declarations should be removed because they needlessly clutter the code and can be confusing.
== Noncompliant Code Example
[source,csharp]
----
public class MyClass : Object // Noncompliant
enum MyEnum : int // Noncompliant
----
== Compliant Solution
[source,csharp]
----
public class MyClass
enum MyEnum
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]