Ashish Kumar Joy
03/22/2021, 6:27 AMWe are trying to use kotlin multiplatform plugin in our project. We have kotlin code as follows
@JsName("Cart")
class Cart(val items: List<CartItem>, val totalPayableAmount: Double)
@JsName("CartItem")
class CartItem(val categoryCode: String, val totalPremium: Double)
class Validator(private val cart: Cart) {
@JsName("isValid")
fun isValid(): Boolean {
return if (cart.totalPayableAmount < 5000) {
cart.items.any { it.categoryCode == "abcd" }
} else {
false
}
}
}
When we try to use compiled js code in html, we get error as follows
`n.iterator_24 is not a function`
which we suspect is because of `any` that we have used in kotlin. Does anyone has any idea reagarding this?
We are using IR compilerrnett
03/22/2021, 6:41 AMturansky
03/22/2021, 7:53 AM@JsExport
annotation to export classes. Duplicated `@JsName`s will be redundant in this caseAshish Kumar Joy
03/22/2021, 3:40 PMAshish Kumar Joy
03/22/2021, 4:16 PMAshish Kumar Joy
03/22/2021, 4:17 PMAshish Kumar Joy
03/22/2021, 4:19 PMandrea.santurbano
03/23/2021, 3:34 PM