I have an external JS class:
external class MyJsClass {
fun number(): Long
}
When I try call this function, the generated code does not convert the Javascript Number
to Kotlin Long
but simply tries to call Kotlin functions on it, eg.
// Kotlin code
val a: MyJsClass = ...
val b: MyJsClass = ...
a.number().compareTo(b.number())
results in a <TypeError: ... .compareTo_11rb$ is not a function>
because the generated code is simply:
// Javascript code
a.number().compareTo_11rb$(b.number())
What should I do to force the conversion to a “real” Kotlin Long
?