tipsy
07/05/2021, 8:22 PMinline fun <reified T : Any> queryParam(key: String) = ...
fun queryParam(key: String) = ...
in kotlin this works fine, but both mockk and mockito get confused, it's random which one of the methods get picked. is there any way of dealing with this?tipsy
07/05/2021, 8:23 PMNick Allen
07/05/2021, 9:38 PMtipsy
07/05/2021, 9:43 PMNick Allen
07/06/2021, 7:43 PM@JvmName("queryParam-inline")
inline fun <reified T : Any> queryParam(key: String) = ...
fun queryParam(key: String) = ...
It won't have the same JVM signature that way. The '-' makes it so you can't accidentally call it from Java. Seemed to work though I didn't give it that many test runs.
Btw, "inline functions don't actually exist in the JVM byte code" was clearly incorrect, sorry. It's there, it's just not invoked at Kotlin call sites.tipsy
07/12/2021, 9:50 PM