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

Kotlin companion object variables being covered as methods #1545

Open
Strydom opened this issue Nov 24, 2023 · 0 comments
Open

Kotlin companion object variables being covered as methods #1545

Strydom opened this issue Nov 24, 2023 · 0 comments
Labels
language: Kotlin type: bug 🐛 Something isn't working

Comments

@Strydom
Copy link

Strydom commented Nov 24, 2023

Steps to reproduce

  • JaCoCo version: 0.8.11
  • Operating system: macOS Sonoma 14.1 / Apple M1
  • Tool integration: Maven
  • Complete executable reproducer:
class MediaAssetAdapter {
    companion object {
        val largestRatioDimensions = mapOf(
            "foo" to "bar"
        )

        val sizeScalingFactors = mapOf(
            "foo" to "bar"
        )
    }
    
    fun doSomething() {
        return "${largestRatioDimensions["foo"]}-${sizeScalingFactors["foo"]}"
    }
}
  • Steps: simply using the variables in some functions

Expected behaviour

These variables are not treated like methods.

Actual behaviour

Screenshot 2023-11-24 at 14 12 46
@Strydom Strydom added the type: bug 🐛 Something isn't working label Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language: Kotlin type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants