Skip to content

suspend inline function is not covered in Kotlin #1751

@shanshin

Description

@shanshin

For the following src/Example.kt

import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking

suspend inline fun suspendInlineFun(f: () -> Int): Int {
    delay(100)
    return f() + 5
}

fun main() {
    runBlocking {
        suspendInlineFun { 6 }
    }
}


execution of

kotlin-2.0.21/bin/kotlinc src -d classes -classpath kotlin-2.0.21/lib/kotlinx-coroutines-core-jvm.jar
java -javaagent:jacoco-0.8.13-SNAPSHOT/lib/jacocoagent.jar -cp classes:kotlin-2.0.21/lib/kotlin-stdlib.jar:kotlin-2.0.21/lib/kotlinx-coroutines-core-jvm.jar ExampleKt
java -jar jacoco-0.8.13-SNAPSHOT/lib/jacococli.jar report jacoco.exec --classfiles classes --sourcefiles src --html report

produces report
Screenshot 2024-10-16 at 15 08 52
Screenshot 2024-10-16 at 15 09 01

Expected behaviour

Function suspendInlineFun should be covered

Environment

  • JaCoCo version: actual master branch built locally
  • Kotlin 2.0.21
  • Operating system: MacOS 15
  • Tool integration: CLI

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions