Skip to content

Proposal: throw error when unused parameter is present #3485

Description

@CyberReaper00

this would be a really useful feature unlike unused variables which dont cause much damage to the codebase, but if there is an unused parameter then it has happened multiple times that i just created the function placed some stuff in there and tried to run the thing with some test data which worked fine and when i wanted to run with the actual data it didnt do what i wanted and i later realized that i forgot to replace my test data within the function with the function parameter

this is something that would actually be useful since a function should never be able to work without all of parameters being provided and also it would show that if the function is doing things that doesnt require those parameters anymore then i know that i need to remove them from the signature now and use the function differently

such as this

fn void f(int a)
{
    io::printn("this shouldnt be allowed");
}
fn int main()
{
    f(12);
    return 0;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions