Kotlin / kotlinx-kover

Apache License 2.0
1.37k stars 53 forks source link

Incorrect enum coverage issue in Kotlin 2.0 #621

Closed dungsil closed 5 months ago

dungsil commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

Coverage of enum classes is incorrectly calculated when using kover in Kotlin 2.0.

Errors If present, stacktraces or files from build/kover/errors directory

N/A

Expected behavior A clear and concise description of what you expected to happen.

Incorrect display of the last ‘}’ string in the Enum class

Kotlin 1.9.23 Kotlin 2.0.0
image image

Reproducer A link to your project, if it is open source. Otherwise, please try to reproduce the problem on a small project. If this is not feasible, give an example of the code on which the problem manifests itself.

Reports If applicable, report files or screenshots.

Kotlin 1.9.23 Kotlin 2.0.0
image image

Environment

shanshin commented 5 months ago

@zuevmaxim , new enums have additional getEntries method and code in <clinit> (private static final EnumEntries $ENTRIES = EnumEntriesKt.enumEntries((Enum[])$VALUES);)

shanshin commented 5 months ago

Fixed in 0.8.2