Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Default constructor for sealed class is not tracked in Kotlin #1746

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

Open
shanshin opened this issue Oct 15, 2024 · 0 comments
Open

Default constructor for sealed class is not tracked in Kotlin #1746

shanshin opened this issue Oct 15, 2024 · 0 comments

Comments

@shanshin
Copy link

For the following src/Example.kt

sealed class SealedClass

abstract class AbstractClass

class SealedSubClass: SealedClass()

class AbstractSubClass: AbstractClass()

fun main() {
    SealedSubClass()
    AbstractSubClass()
}

execution of

kotlin-2.0.21/bin/kotlinc src -d classes
java -javaagent:jacoco-0.8.13-SNAPSHOT/lib/jacocoagent.jar -cp classes:kotlin-2.0.21/lib/kotlin-stdlib.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-15 at 16 31 47
Screenshot 2024-10-15 at 16 31 59

Expected behaviour

<init>() constructor for sealed classes should be tracked in the same way as the abstract classes

Environment

  • JaCoCo version: actual master branch built locally
  • Kotlin 2.0.21
  • Operating system: MacOS 15
  • Tool integration: CLI
@shanshin shanshin added the type: bug 🐛 Something isn't working label Oct 15, 2024
@Godin Godin self-assigned this Oct 15, 2024
@Godin Godin added this to Filtering Oct 15, 2024
@github-project-automation github-project-automation bot moved this to Awaiting triage in Filtering Oct 15, 2024
@Godin Godin moved this from Awaiting triage to To Do in Filtering Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Do
Development

No branches or pull requests

2 participants