Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superfluous threshold override check on overloaded functions #3

Open
belka-ew opened this issue Oct 16, 2023 · 0 comments
Open

Superfluous threshold override check on overloaded functions #3

belka-ew opened this issue Oct 16, 2023 · 0 comments

Comments

@belka-ew
Copy link
Collaborator

Problem

Assuming I have overloaded functions with different complexity:

module g.h;

import std.stdio;

void f(char x)
{
}

void f(bool x)
{
    if (x)
    {
        bool y = !x;

        if (y)
        {
            writeln("x, y: true");
        }
        else
        {
            writeln("x: true, y: false");
        }
    }
    else
    {
        bool y = !x;

        if (y)
        {
            writeln("x: false, y: true");
        }
        else
        {
            writeln("x, y: false");
        }
    }
}

The complexity of the empty function is 0, the other one 8.

I have a configuration file as well:

[g.h]
f = 10

Cogito fails with the error code 6:

test.d:5: function f: 0 (this symbol shouldn't be excluded anymore)

Possible solution

If the exclusion rule applies to (excludes) at least one function overload, ignore the others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant