mockk
mockk copied to clipboard
Overload resolution ambiguity between candidates
When i use mockk on a kmp project, I get these errors in the IDE (the tests run fine regardless)
Overload resolution ambiguity between candidates: fun <reified T : Any> slot(): CapturingSlot<T> fun <reified T> slot(): CapturingSlot<T>
Looking at the code, it looks like the jvm and common source sets define the slot method differently:
// common
inline fun <reified T : Any> slot() = MockK.useImpl {
MockKDsl.internalSlot<T>()
}
// jvm
inline fun <reified T : Any?> slot() = MockK.useImpl {
MockKDsl.internalSlot<T>()
}
Which seems to be the reason for the error.