
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
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
== Why is this an issue?
|
|
|
|
``++partial++`` methods allow an increased degree of flexibility in programming a system. Hooks can be added to generated code by invoking methods that define their signature, but might not have an implementation yet. But if the implementation is still missing when the code makes it to production, the compiler silently removes the call. In the best case scenario, such calls simply represent cruft, but in they worst case they are critical, missing functionality, the loss of which will lead to unexpected results at runtime.
|
|
|
|
|
|
This rule raises an issue for partial methods for which no implementation can be found in the assembly.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,csharp]
|
|
----
|
|
partial class C
|
|
{
|
|
partial void M(); //Noncompliant
|
|
|
|
void OtherM()
|
|
{
|
|
M(); //Noncompliant. Will be removed.
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
* Supply an implementation for the partial method, otherwise this call will be ignored.
|
|
* Supply an implementation for this partial method.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 20 Jul 2015, 11:43:13 Tamas Vajk wrote:
|
|
\[~ann.campbell.2] LGTM
|
|
|
|
endif::env-github,rspecator-view[]
|