MJegorovas
10/08/2021, 10:23 AMInt64
to KotlinLong?
, example in thread.MJegorovas
10/08/2021, 10:24 AMlet long: Int64 = 5
kotlinFun(value: long)
Kotlin code:
fun kotlinFun (value: Long?) {}
MJegorovas
10/08/2021, 10:26 AMlet long: Int64 = 5
kotlinFun(value: KotlinLong(value: long))
MJegorovas
10/08/2021, 10:28 AMInt64?
then you have to do something like this:
let long: Int64? = 5
if long == nil {
kotlinFun(value: nil)
} else {
kotlinFun(value: KotlinLong(value: long!))
}
The same thing happens with Int
(and other numeric types), but not with String
Any better solutions?ephemient
10/08/2021, 5:57 PMkotlinFun(value: long.map { KotlinLong(value: $0) })
to work, not sure if there's a simpler way