D-Scanner icon indicating copy to clipboard operation
D-Scanner copied to clipboard

False positive "Argument 1 is named 'expected', but this is the name of parameter 2"

Open andre2007 opened this issue 7 years ago • 0 comments

While executing dscanner -S for d-unit there are false positives like this example:

.\src\dunit\ng\assertion.d(24:18)[warn]: Argument 1 is named 'expected', but this is the name of parameter 2

In module dunit.ng.assertion there is this function

void assertEquals(T, U)(T actual, U expected, lazy string msg = null,
        string file = __FILE__,
        size_t line = __LINE__)
{
    import dunit.assertion : assertEquals;

    assertEquals(expected, actual, msg, file, line);
}

The assertEquals function which is called within the function assertEquals is another function from another module which has an other order of arguments.

But D-Scanner uses the signature from the outer function.

andre2007 avatar Nov 10 '17 16:11 andre2007