Open sschuberth opened 3 weeks ago
I have added TC for
@Test
fun `does not report when suspend function is called in extension method`() {
val code = """
import kotlinx.coroutines.delay
suspend fun foo() { delay(1000) }
suspend fun String.bar() {
foo()
}
suspend fun String.baz() = foo()
""".trimIndent()
assertThat(subject.compileAndLintWithContext(env, code)).isEmpty()
}
And extension method detection working fine. Are you running detect tasks with the correct type resolution?
Are you running detect tasks with the correct type resolution?
What do you mean by "correct"? But yes, I'm using type resolution in general, i.e. I run the detektMain
task instead of the detekt
task.
Hi @sschuberth it could detekt is unable to determine dbQueryCatching(transactionIsolation, readOnly, block)
as suspend fun. Or can you give complete self-reproducible example where false +ve is coming
Expected Behavior
RedundantSuspendModifier
should not complain forsuspend
functions that callsuspend
functionsObserved Behavior
RedundantSuspendModifier
is reported for this code:with
Steps to Reproduce
Run Detekt with type resolution (
./gradlew detektMain
) on https://github.com/eclipse-apoapsis/ort-server/blob/main/services/infrastructure/src/main/kotlin/InfrastructureServiceService.ktContext
n/a
Your Environment
--scan
option when running the gradle task): n/a