Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@t-kameyama
Copy link
Contributor

Fixes #4591

@marschwar
Copy link
Contributor

marschwar commented Mar 7, 2022

Should those examples below be considered ok or not?

class Baz {
    private var b: Int = 42
    fun foo(a: Int, b: Int, c: Int) {}
    fun bar(a: Int, c: Int) {
        foo(a, this.b, c)
    }
}
data class Baz(val b: Int)
fun foo(a: Int, b: Int, c: Int) {}
fun bar(a: Int, c: Int, baz: Baz?) {
    baz?.let { foo(a, it.b, c) }
}

[edit] To be clear, it think they should be flagged (as it is implemented) but I would like to have a test case that verifies it.

@BraisGabin BraisGabin added this to the 1.20.0 milestone Mar 10, 2022
@BraisGabin BraisGabin merged commit 1269b9b into detekt:main Mar 10, 2022
@t-kameyama t-kameyama deleted the issue_4591 branch March 10, 2022 11:46
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

Successfully merging this pull request may close these issues.

NamedArguments: Ignore when argument values are the same as the parameter names

4 participants