kotlin-inject icon indicating copy to clipboard operation
kotlin-inject copied to clipboard

Fix #459: Suppress "Redundant visibility modifier" Warnings in Generated Code

Open leinardi opened this issue 1 year ago • 3 comments

Fix for #459

image

image

leinardi avatar Jan 02 '25 13:01 leinardi

Going to wait for https://github.com/evant/kotlin-inject/pull/350 to be merged first so that a test can be written using -Wextra, ex:

    @ParameterizedTest
    @EnumSource(Target::class)
    fun does_not_warn_by_default(target: Target) {
        val projectCompiler = ProjectCompiler(target, workingDir)

        assertThat(
            projectCompiler.source(
                "MyComponent.kt",
                """
                import me.tatarka.inject.annotations.Component

                @Component abstract class MyComponent {
                }
                """.trimIndent()
            ).compile()
        ).warnings().isEmpty()
    }

evant avatar Jan 02 '25 21:01 evant

@evant Hey, now that #350 has been merged, could you add the test so we can merge this PR as well? I’d do it myself, but I’m not too familiar with this particular test. I’d really appreciate it if you could take care of it.

leinardi avatar Jan 13 '25 15:01 leinardi

Yep was planning on adding it eventually if you didn't get to it.

evant avatar Jan 13 '25 18:01 evant