Closed AndrazP closed 3 months ago
Hi! What is your Kotlin version and Mokkery version?
Kotlin 2.0.0, Mokkery 2.1.1
I've found the problem and I should be able to fix this in the next release. As a workaround you can ignore final members in Gradle file:
mokkery {
ignoreFinalMembers.set(true)
}
It's fixed. It will be available with the next release.
Thank you! Do you think it's a bug in all-open plugin?
Not really. It affects mocking classes in general. The problem is that Wasm has 2 extra internal final members in kotlin.Any
- var _hashCode: Int
and var typeInfo: Int
. I'm not sure if they should be visible for compiler plugins, but they are. The simple fix is to ignore them when validating types to mock.
Hi!
I ran into an issue integrating Mokkery on WasmJs only Kotlin Multiplatform project. I suspect it's an all-open plugin issue, but I would like to hear your opinion.
So this works:
But my classes don't have interfaces and I don't want to change that. I see an alternative is using all-open plugin.
This does not seem to work at all. Mokkery still complains that class is final. So I have implemented a custom annotation.
After this the error has changed:
Are you familiar with this error? How can I confirm that classes are opened correctly?