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

False-positive on unusedArguments #1696

Closed
romdevios opened this issue May 13, 2024 · 2 comments
Closed

False-positive on unusedArguments #1696

romdevios opened this issue May 13, 2024 · 2 comments
Labels
bug fixed in develop bug/feature resolved in the develop branch

Comments

@romdevios
Copy link

Parameter in this code counts as unused because placed on the next lines after the same named parameter created.

func someFunction(with parameter: Int) -> Int {
    let parameter = max(
        200,
        parameter
    )
    return parameter
}

Formatted to and not compiling anymore:

func someFunction(with _: Int) -> Int {
    let parameter = max(
        200,
        parameter
    )
    return parameter
}
@nicklockwood
Copy link
Owner

@romdevios thanks for reporting this, I'll get it fixed. A workaround for now seems to be to put the expression all on one line:

let parameter = max(200, parameter)

@nicklockwood nicklockwood added the fixed in develop bug/feature resolved in the develop branch label May 18, 2024
@nicklockwood
Copy link
Owner

@romdevios fixed in 0.53.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed in develop bug/feature resolved in the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants