
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
46 lines
894 B
Plaintext
46 lines
894 B
Plaintext
== Why is this an issue?
|
|
|
|
When only a single ``++public++`` parameterless constructor is defined in a class, then that constructor can be removed because the compiler would generate it automatically. Similarly, empty ``++static++`` constructors and empty destructors are also wasted keystrokes.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,csharp]
|
|
----
|
|
class Sample
|
|
{
|
|
public Sample() { } // Noncompliant
|
|
static Sample() { } // Noncompliant
|
|
~Sample() { } // Noncompliant
|
|
|
|
...
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,csharp]
|
|
----
|
|
class Sample
|
|
{
|
|
...
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== is related to: S1186
|
|
|
|
=== on 22 Mar 2016, 17:05:44 Tamas Vajk wrote:
|
|
\[~ann.campbell.2] Could you review this spec? Thanks
|
|
|
|
=== on 22 Mar 2016, 17:36:16 Ann Campbell wrote:
|
|
looks good [~tamas.vajk]
|
|
|
|
endif::env-github,rspecator-view[]
|