Reporter | Johan Tidén (jtiden) |
---|---|
Created | Jan 28, 2012 6:28:25 PM |
Updated | Jan 28, 2012 6:29:09 PM |
Priority | Normal |
Type | Unspecified |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Evgeny Pasynkov (pasynkov) |
Subsystem | Code Analysis - Usage Checking |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
"Parameter <x> is only used for precondition check(s)" activates when a parameter is only used for and makes resharper behave like UnusedParameter.Local.
However, when the whole body of the function is supposed to be the precondition check(s), this advice is useless since the user intentionally designed it like this. (see code example)
However, when the whole body of the function is supposed to be the precondition check(s), this advice is useless since the user intentionally designed it like this. (see code example)
public IMatrixDense Multiply(IMatrixDense other) { CheckMatrixDimensionAgree(other); return new MatrixMultiplier(this, other).MultiplyToDense(); } private void CheckMatrixDimensionAgree(Matrix other) // warning "Parameter other is only used for precondition check(s)" { if(Columns != other.Rows) throw new ArgumentException("Inner matrix dimensions must agree."); }