78 lines
1.1 KiB
Plaintext
78 lines
1.1 KiB
Plaintext
The name of a parameter in an externally visible. This rule raises an issue when method override does not match the name of the parameter in the base declaration of the method, or the name of the parameter in the interface declaration of the method or the name of any other ``++partial++`` definition.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
partial class Point
|
|
{
|
|
partial void MoveVertically(int z);
|
|
}
|
|
|
|
partial class Point
|
|
{
|
|
int x = 0;
|
|
int y = 0;
|
|
int z = 0;
|
|
|
|
partial void MoveVertically(int y) // Noncompliant
|
|
{
|
|
this.y = y;
|
|
}
|
|
}
|
|
|
|
interface IFoo
|
|
{
|
|
void Bar(int i);
|
|
}
|
|
|
|
class Foo : IFoo
|
|
{
|
|
void Bar(int z) // Noncompliant, parameter name should be i
|
|
{
|
|
}
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
partial class Point
|
|
{
|
|
partial void MoveVertically(int z);
|
|
}
|
|
|
|
partial class Point
|
|
{
|
|
int x = 0;
|
|
int y = 0;
|
|
int z = 0;
|
|
|
|
partial void MoveVertically(int z)
|
|
{
|
|
this.z = z;
|
|
}
|
|
}
|
|
|
|
interface IFoo
|
|
{
|
|
void Bar(int i);
|
|
}
|
|
|
|
class Foo : IFoo
|
|
{
|
|
void Bar(int i)
|
|
{
|
|
}
|
|
}
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|