Skip to content
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

Incorrect enum coverage issue in Kotlin 2.0 #621

Closed
dungsil opened this issue Jun 4, 2024 · 2 comments · Fixed by #631
Closed

Incorrect enum coverage issue in Kotlin 2.0 #621

dungsil opened this issue Jun 4, 2024 · 2 comments · Fixed by #631
Assignees
Labels
Bug Bug issue type S: ready for release Status: merged in the main branch

Comments

@dungsil
Copy link

dungsil commented Jun 4, 2024

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

  • Kover Gradle Plugin version: 0.8.0
  • Gradle version: 8.7
  • Kotlin project type: Kotlin/JVM (Spring boot)
  • Coverage Toolset (if customized in build script): Kover
  • Other context important for this bug: Windows 11
@dungsil dungsil added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Jun 4, 2024
@shanshin
Copy link
Collaborator

shanshin commented Jun 4, 2024

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

@shanshin shanshin added S: confirmed Status: bug is reproduced or present and removed S: untriaged Status: issue reported but unprocessed labels Jun 4, 2024
shanshin added a commit that referenced this issue Jun 11, 2024
@shanshin shanshin reopened this Jun 12, 2024
@shanshin shanshin added S: ready for release Status: merged in the main branch and removed S: confirmed Status: bug is reproduced or present labels Jun 12, 2024
@shanshin
Copy link
Collaborator

Fixed in 0.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: ready for release Status: merged in the main branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants