-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
RedundantSuspendModifier
false-positives with extension functions
#7223
Comments
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? |
What do you mean by "correct"? But yes, I'm using type resolution in general, i.e. I run the |
Hi @sschuberth it could detekt is unable to determine |
RedundantSuspendModifier
false-posiotives with extension functionsRedundantSuspendModifier
false-positives with extension functions
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
This has too many false-positives, see [1]. [1]: detekt/detekt#7223 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
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/aThe text was updated successfully, but these errors were encountered: