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

NPE with new Kotlin IR compiler #17

Open
ZakTaccardi opened this issue Jun 24, 2021 · 1 comment
Open

NPE with new Kotlin IR compiler #17

ZakTaccardi opened this issue Jun 24, 2021 · 1 comment

Comments

@ZakTaccardi
Copy link

ZakTaccardi commented Jun 24, 2021

Using Kotlin 1.5

typealias FeatureName = String

data class Feature(
    val name: FeatureName,
    val default: Boolean
) {
    companion object
}
@Test
fun `Koverage cover`() {
    // For data classes
    Koverage.cover(Feature::class)
}
java.lang.NullPointerException
	at com.company.Feature.hashCode(Feature.kt)
	at net.sarazan.koverage.testers.DataTester.coverHash(DataTester.kt:52)
	at net.sarazan.koverage.testers.DataTester.cover(DataTester.kt:28)
	at net.sarazan.koverage.testers.DataTester$Companion.cover(DataTester.kt:18)
	at net.sarazan.koverage.Koverage.cover(Koverage.kt:23)
	at com.company.FeatureTest.Koverage cover(FeatureTest.kt:11)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
@ZakTaccardi
Copy link
Author

Btw, the fix ended up being:

Screen Shot 2021-08-10 at 2 13 02 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant