grahamborland
04/01/2022, 3:01 PMLong
and Number
. I have this Kotlin code:
@JsExport
fun isNegative(amount: Long) : Boolean = amount < 0L
which fails at runtime in Typescript because
TypeError: amount.compareTo_n4fqi2_k$ is not a function
Can someone gently guide me towards what kind of solutions I should be investigating? Should I just not use Long
in the Kotlin code, or should I be adding some conversion logic somewhere?grahamborland
04/01/2022, 3:04 PMephemient
04/01/2022, 3:05 PMBig Chungus
04/01/2022, 3:18 PMgrahamborland
04/01/2022, 3:22 PMBig Chungus
04/01/2022, 3:24 PMgrahamborland
04/01/2022, 3:26 PMInt
isn’t big enough on Android/iOS though. I’d love to find a compromise where I can use a Long
implementation on platforms which support it, and floating-point on JS. I’ll see if I can get anywhere with `expect`/`actual`Big Chungus
04/01/2022, 3:28 PMBig Chungus
04/01/2022, 3:30 PMephemient
04/01/2022, 3:50 PMephemient
04/01/2022, 3:51 PMgrahamborland
04/01/2022, 4:31 PMexpect class YNum : Number, Comparable<YNum>
Android/iOS:
actual typealias YNum = Long
JS:
actual typealias YNum = Double
ephemient
04/02/2022, 5:26 AMx / y * y
will give different results on different platformsephemient
04/02/2022, 5:26 AM