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

AlsoCouldBeApply: false positive when all statements are not it-started expressions #5375

Closed
t-kameyama opened this issue Oct 5, 2022 · 0 comments · Fixed by #5376
Closed
Labels

Comments

@t-kameyama
Copy link
Contributor

Steps to Reproduce

@Test
fun `does not report when all statements are not 'it'-started expressions`() {
    val code = """
        fun test(foo: Foo) {
            foo.also {
                it.bar()
                println(it)
                it.baz()
            }
        }

        class Foo {
            fun bar() {}
            fun baz() {}
        }
    """.trimIndent()
    assertThat(subject.compileAndLint(code)).isEmpty()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant