https://kotlinlang.org logo
b

Brian G

11/18/2021, 5:10 PM
I'm hitting the weirdest bug in production randomly (automated reporting) and I don't know how to reproduce... This code:
Copy code
fun apiUrl(param: String): String {
    return "/v2/$param"
}
Is somehow returning
"/v2/kotlin.Unit"
and hitting my server. Anyone seen anything like this? My code is multiplatform (Android/iOS/JS), but these are only coming from the iOS Kotlin/native version.
😬 1
c

Clocks

11/18/2021, 5:11 PM
Did you try a clean build?
b

Brian G

11/18/2021, 5:48 PM
Yes, doesn't make a difference
c

Clocks

11/18/2021, 8:01 PM
What does the calling site from IOS Kotlin/Native look like?
b

Brian G

11/18/2021, 10:57 PM
All Kotlin from the ViewModel all the way down. E.g. I instantiate a kotlin class repreesnting the whole app
let app = AppViewModel()
, and then there's Swift code just binds to some view model fields to render things into UIViews. This call happens pretty deep in Kotlin-land