org.sonar.plugins.csharp.S3600.html Maven / Gradle / Ivy
Why is this an issue?
Adding params to a method override has no effect.
The compiler accepts it, but the callers won’t be able to benefit from the added modifier.
Noncompliant code example
class Base
{
public virtual void Method(int[] numbers)
{
...
}
}
class Derived : Base
{
public override void Method(params int[] numbers) // Noncompliant, method can't be called with params syntax.
{
...
}
}
Compliant solution
class Base
{
public virtual void Method(int[] numbers)
{
...
}
}
class Derived : Base
{
public override void Method(int[] numbers)
{
...
}
}
Resources
Documentation
© 2015 - 2024 Weber Informatics LLC | Privacy Policy